checkMWRresults {MassWateR}R Documentation

Check water quality monitoring results

Description

Check water quality monitoring results

Usage

checkMWRresults(resdat, warn = TRUE)

Arguments

resdat

input data frame for results

warn

logical to return warnings to the console (default)

Details

This function is used internally within readMWRresults to run several checks on the input data for completeness and conformance to WQX requirements.

The following checks are made:

Value

resdat is returned as is if no errors are found, otherwise an informative error message is returned prompting the user to make the required correction to the raw data before proceeding. Checks with warnings can be fixed at the discretion of the user before proceeding.

Examples

library(dplyr)

respth <- system.file('extdata/ExampleResults.xlsx', package = 'MassWateR')

resdat <- suppressWarnings(readxl::read_excel(respth, na = c('NA', 'na', ''), guess_max = Inf)) %>% 
  dplyr::mutate_if(function(x) !lubridate::is.POSIXct(x), as.character)
             
checkMWRresults(resdat)

[Package MassWateR version 2.1.4 Index]