get_wq {dbhydroR}R Documentation

Retrieve water quality data from the DBHYDRO Environmental Database

Description

Retrieve water quality data from the DBHYDRO Environmental Database

Usage

get_wq(
  station_id = NA,
  date_min = NA,
  date_max = NA,
  test_name = NA,
  mdl_handling = "raw",
  raw = FALSE,
  qc_strip = "N",
  qc_field = "N",
  test_number = NA,
  v_target_code = "file_csv",
  sample_id = NA,
  project_code = NA
)

Arguments

station_id

character string of station id(s). See the SFWMD station search utility for specific options

date_min

character date must be in POSIXct YYYY-MM-DD format

date_max

character date must be in POSIXct YYYY-MM-DD format

test_name

character string of test name(s). See the SFWMD Station Maps at https://www.sfwmd.gov/documents-by-tag/emmaps for specific options

mdl_handling

character string specifying the handling of measurement values below the minimum detection limit (MDL). Example choices for this argument include:

  • raw: Returns values exactly as they are stored in the database. Current practice is to return values below the MDL as 0 minus the uncertainty estimate.

  • half: Returns values below the MDL as half the MDL

  • full: Returns values below the MDL as the MDL

raw

logical default is FALSE, set to TRUE to return data in "long" format with all comments, qa information, and database codes included

qc_strip

logical set TRUE to avoid returning QAQC flagged data entries

qc_field

logical set TRUE to avoid returning field QC results

test_number

numeric test name alternative (not implemented)

v_target_code

string print to file? (not implemented)

sample_id

numeric (not implemented)

project_code

numeric (not implemented)

Details

By default, get_wq returns a cleaned output. First, the cleaning function clean_wq converts the raw output from native DBHYDRO long format (each piece of data on its own row) to wide format (each site x variable combination in its own column). Next, the extra columns associated with QA flags, LIMS, and District receiving are removed. Finally, row entries associated with QA field blanks, which are used to check on potential sources of contamination, are removed. Setting the raw flag to TRUE will force getwq to retain information on QA field blanks as well as the other QA fields.

Examples


## Not run: 
#one variable and one station
get_wq(station_id = "FLAB08",
date_min = "2011-03-01", date_max = "2012-05-01",
test_name = "CHLOROPHYLLA-SALINE")

#one variable at multiple stations
get_wq(station_id = c("FLAB08", "FLAB09"),
date_min = "2011-03-01", date_max = "2012-05-01",
test_name = "CHLOROPHYLLA-SALINE")

#One variable at a wildcard station
get_wq(station_id = c("FLAB0%"),
date_min = "2011-03-01",
date_max = "2012-05-01",
test_name = "CHLOROPHYLLA-SALINE")

#multiple variables at multiple stations
get_wq(station_id = c("FLAB08", "FLAB09"),
date_min = "2011-03-01", date_max = "2012-05-01",
test_name = c("CHLOROPHYLLA-SALINE", "SALINITY"))

## End(Not run)

[Package dbhydroR version 0.2-8 Index]