checkMWRcens | R Documentation |
Check censored data
checkMWRcens(censdat, warn = TRUE)
censdat |
input data frame for results |
warn |
logical to return warnings to the console (default) |
This function is used internally within readMWRcens
to run several checks on the input data for completeness and conformance.
The following checks are made:
Column name spelling: Should be the following: Parameter, Missed and Censored Records
Columns present: All columns from the previous check should be present
Non-numeric or empty entries in Missed and Censored Records: All values should be numbers
Negative Missed and Censored Records: All values should be greater than or equal to zero
Parameter: Should match parameter names in the Simple Parameter
or WQX Parameter
columns of the paramsMWR
data (warning only)
censdat
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.
censpth <- system.file('extdata/ExampleCensored.xlsx', package = 'MassWateR')
censdat <- suppressWarnings(readxl::read_excel(censpth, na = c('NA', 'na', ''), guess_max = Inf))
checkMWRcens(censdat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.