-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added enterodata_since1995 and associated documentation
- Loading branch information
Showing
4 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#' Enterococcus data from 53 key Enterococcus stations since 1995 | ||
#' | ||
#' Note, the data frame was created and named with 1995-2023 as the date range in the Water Quality Portal call, but the first actual date is 2 Aug 2000. | ||
#' | ||
#' @format A data frame with 6207 rows and 12 columns: | ||
#' \describe{ | ||
#' \item{date}{data, sample date} | ||
#' \item{station}{character, sample station, as named in the Water Quality Portal} | ||
#' \item{ecocci}{numeric, sample's Enterococcus concentration} | ||
#' \item{ecocci_censored}{logical, whether sample concentration was censored (below detection limit)} | ||
#' \item{Latitude}{numeric, latitude in decimal degrees} | ||
#' \item{Longitude}{numeric, longitude in decimal degrees} | ||
#' \item{ecocci_units}{character, units of measurement of Enterococcus} | ||
#' \item{time}{character, time sample was obtained, in 24hr format} | ||
#' \item{time_zone}{character, time zone of sample time} | ||
#' \item{MDL}{numeric, minimum detection limit of laboratory for Enterococcus} | ||
#' \item{yr}{numeric year of sample date} | ||
#' \item{mo}{numeric month of sample date} | ||
#' } | ||
#' @details | ||
#' A sample dataset containing Enterococcus from 53 stations in the TBEP watershed from 2000-2023. Generated by \code{data-raw/enterodata_since1995-raw.R} (view on github: \url{https://github.com/tbep-tech/tbeptools/blob/master/data-raw/enterodata_since1995-raw.R}) | ||
#' @source Water Quality Portal, \url{https://waterqualitydata.us} | ||
#' | ||
|
||
"enterodata_since1995" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# all data from key Enterococcus stations, 1995-2023 | ||
# although apparently data collection only started in 2000 at the earliest of these stations | ||
|
||
stations <- unique(catch_precip$station) | ||
entero_names <- c('Enterococci', | ||
'Enterococcus') | ||
startDate <- as.Date('1995-01-01') | ||
endDate <- as.Date('2023-12-31') | ||
|
||
args <- list( | ||
siteid = stations, | ||
characteristicName = entero_names, | ||
startDateLo = format(startDate, '%m-%d-%Y'), | ||
startDateHi = format(endDate, '%m-%d-%Y') | ||
) | ||
# date format has to be mm-dd-yyyy | ||
|
||
enterodata_since1995 <- read_importentero(args = args) %>% | ||
dplyr::select(-qualifier, | ||
-LabComments) | ||
|
||
save(enterodata_since1995, file = 'data/enterodata_since1995.RData', compress = 'xz') |
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.