formMWRresults: Format water quality monitoring results

View source: R/formMWRresults.R

formMWRresultsR 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 to Simple Parameter in paramsMWR 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)

massbays-tech/MassWateR documentation built on April 12, 2025, 7:53 p.m.