formMWRresults {MassWateR} | R Documentation |
Format water quality monitoring results
Description
Format water quality monitoring results
Usage
formMWRresults(resdat, tzone = "America/Jamaica")
Arguments
resdat |
input data frame for results |
tzone |
character string for time zone |
Details
This function is used internally within readMWRresults
to format the input data for downstream analysis. The formatting includes:
Fix date and time inputs: Activity Start Date is converted to YYYY-MM-DD as a date object, Actvity Start Time is convered to HH:MM as a character to fix artifacts from Excel import
Minor formatting for Result Unit: For conformance to WQX, e.g., ppt is changed to ppth, s.u. is changed to NA
Convert characteristic names: All parameters in
Characteristic Name
are converted toSimple Parameter
inparamsMWR
as needed
Value
A formatted data frame of the water quality monitoring results file
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)
formMWRresults(resdat)
[Package MassWateR version 2.1.4 Index]