Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Imports:
rvest
URL: https://github.com/InteragencyEcologicalProgram/zooper
BugReports: https://github.com/InteragencyEcologicalProgram/zooper/issues
RoxygenNote: 7.3.2
RoxygenNote: 7.3.3
Suggests:
spelling,
testthat (>= 2.1.0),
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# zooper (development version)

- Added EMP data released in June 2025 (sampling from 1972–2023), **which no longer includes amphipods in the macro dataset**; see the [amphipods_notes (EDI 522)](https://portal.edirepository.org/nis/mapbrowse?scope=edi&identifier=522) for more information.
- Added EMP and FRP data released in May 2026
- Added EMP data released in June 2025 (sampling from 1972–2023), **which no longer includes amphipods in the macro dataset**; see the [amphipods_notes (EDI 522)](https://portal.edirepository.org/nis/mapbrowse?scope=edi&identifier=522) for more information.
- ~~Fixed issue where EMP macro amphipod counts from before 2014 were being converted to unidentified mysids instead of unidentified amphipods, since amphipods were not identified to species before 2014.~~
- Fixed issue with biomass conversion for macro and micro zooplankton. Previously it was not taking into account the count and instead providing the BPUE if 1 individual were present.
- Added the biomass for the surveys and size classes with the appropriate conversation factors and length data. This feature is still experimental
Expand Down
11 changes: 7 additions & 4 deletions R/Download_utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ zoop_urls<-function(Sources){
EMP_name_urls <- paste("https://pasta.lternet.edu/package/name/eml/edi/522", EMP_latest_revision, EMP_entities, sep="/")
names(EMP_entities) <- purrr::map_chr(EMP_name_urls, ~Tryer(n=3, fun=readLines, con=.x, warn = FALSE))

out$EMP$Meso<-paste0(EMP_pkg_url, "/", EMP_entities["1972-2023_CBMatrix_EDI"])
out$EMP$Micro<-paste0(EMP_pkg_url, "/", EMP_entities["1972-2023_PumpMatrix_EDI"])
out$EMP$Macro<-paste0(EMP_pkg_url, "/", EMP_entities["1972-2023_MysidMatrix_EDI"])
out$EMP$Lengths<-paste0(EMP_pkg_url, "/", EMP_entities["1972-2023_Mysid_Length_Data_EDI"])
out$EMP$Meso<-paste0(EMP_pkg_url, "/", EMP_entities["1972-2024_CBMatrix_EDI"])
out$EMP$Micro<-paste0(EMP_pkg_url, "/", EMP_entities["1972-2024_PumpMatrix_EDI"])
out$EMP$Macro<-paste0(EMP_pkg_url, "/", EMP_entities["1972-2024_MysidMatrix_EDI"])
out$EMP$Lengths<-paste0(EMP_pkg_url, "/", EMP_entities["1972-2024_Mysid_Length_Data_EDI"])

}

Expand Down Expand Up @@ -159,3 +159,6 @@ zoop_urls<-function(Sources){

return(out)
}

#set options to allow access to EDI without signing in
#options(HTTPUserAgent="EDI_CodeGen")
12 changes: 7 additions & 5 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' A crosswalk table relating the taxonomic code used by each dataset to current scientific names, life stages, and taxonomic hierarchies.
#'
#' @format a tibble with 404 rows and 34 variables
#' @format a tibble with 471 rows and 37 variables
#' \describe{
#' \item{EMP_Micro}{Taxonomic codes used in the Environmental Monitoring Program microzooplankton (43 \eqn{\mu}m) mesh dataset}
#' \item{EMP_Meso}{Taxonomic codes used in the Environmental Monitoring Program mesozooplankton (160 \eqn{\mu}m) mesh dataset}
Expand Down Expand Up @@ -36,6 +36,8 @@
#' \item{twentymmstart2}{First year the 20mm Survey restarted counting this taxa}
#' \item{DOPstart}{First year DOP starting counting this taxa}
#' \item{DOPend}{Last year DOP counted this taxa}
#' \item{FRPstart}{First year FRP starting counting this taxa}
#' \item{FRPend}{Last year FRP counted this taxa}
#' }
#' @seealso \code{\link{Zoopdownloader}}, \code{\link{Zoopsynther}}, \code{\link{zooper}}
"crosswalk"
Expand All @@ -57,7 +59,7 @@
#'
#' Latitudes and longitudes for each zooplankton station.
#'
#' @format a tibble with 387 rows and 4 columns
#' @format a tibble with 399 rows and 4 columns
#' \describe{
#' \item{Source}{Abbreviated name of the source dataset}
#' \item{Station}{Sampling station name}
Expand All @@ -71,7 +73,7 @@
#'
#' Latitudes and longitudes for EMP EZ stations on each sampling date from 2004 to present.
#'
#' @format a tibble with 491 rows and 4 columns
#' @format a tibble with 575 rows and 4 columns
#' \describe{
#' \item{Date}{Date sample was collected}
#' \item{Station}{Sampling station name}
Expand All @@ -85,7 +87,7 @@
#'
#' All source zooplankton datasets combined into one tibble.
#'
#' @format a tibble with 3,615,105 rows and 14 columns.
#' @format a tibble with 3,833,994 rows and 14 columns.
#' \describe{
#' \item{Source}{Abbreviated name of the source dataset. "EMP"=Environmental Monitoring Program, "FRP"=Fish Restoration Program, "FMWT"= Fall Midwater Trawl, "STN"= Townet Survey, "20mm" =20mm survey, "DOP" = Directed Outflow Project Lower Trophic Study, and "YBFMP"= Yolo Bypass Fish Monitoring Program.}
#' \item{SizeClass}{Net size class. Micro corresponds to 43-50 \eqn{\mu}m mesh, Meso corresponds to 150-160 \eqn{\mu}m mesh, and Macro corresponds to 500-505 \eqn{\mu}m mesh. However, prior to 1974 EMP macrozooplankton were sampled with a 930 \eqn{\mu}m mesh net.}
Expand All @@ -112,7 +114,7 @@
#' Accessory environmental data from the combined zooplankton dataset. Not all datasets report all environmental parameters.
#'
#' @encoding UTF-8
#' @format a tibble with 44,690 rows and 20 columns
#' @format a tibble with 48,933 rows and 20 columns
#' \describe{
#' \item{Source}{Abbreviated name of the source dataset. "EMP"=Environmental Monitoring Program, "FRP"=Fish Restoration Program, "FMWT"= Fall Midwater Trawl, "STN"= Townet Survey, "20mm" =20mm survey, "DOP" = Directed Outflow Project Lower Trophic Study, and "YBFMP"= Yolo Bypass Fish Monitoring Program.}
#' \item{Year}{Year sample was collected}
Expand Down
5 changes: 2 additions & 3 deletions R/zoop_downloader.R
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ Zoopdownloader <- function(
dplyr::filter(!is.na(.data$SampleDate))%>%
dplyr::mutate(SampleDate=lubridate::parse_date_time(.data$SampleDate, "%m/%d/%Y", tz="America/Los_Angeles"),
Datetime=lubridate::parse_date_time(dplyr::if_else(is.na(.data$Time), NA_character_, paste(.data$SampleDate, .data$Time)),
c("%Y-%m-%d %I:%M %p"), tz="Etc/GMT+8"), #create a variable for datetime
c("%Y-%m-%d %H:%M"), tz="Etc/GMT+8"), #create a variable for datetime
Datetime=lubridate::with_tz(.data$Datetime, "America/Los_Angeles"))%>% # Ensure everything ends up in local time
tidyr::pivot_longer(cols=c(-"SampleDate", -"StationNZ", -"Time", -"Secchi", -"Chl_a", -"Temperature",
-"ECSurfacePreTow", -"ECBottomPreTow", -"Volume", -"Datetime", -"Depth"),
Expand Down Expand Up @@ -823,7 +823,6 @@ Zoopdownloader <- function(
CommonName == "Palaemonetes" ~ "Palaemon",
CommonName == "Hymenoptera UNID" ~ "Hymenoptera Other",
CommonName == "Asellidae UNID" ~ "Asellidae",
CommonName == "Diptera adult" ~ "Diptera Adult",
CommonName == "Coleoptera other" ~ "Coleoptera Other",
CommonName == "Tricoptera larvae UNID"~"Trichoptera larvae Other",
TRUE ~ CommonName))
Expand Down Expand Up @@ -903,7 +902,7 @@ Zoopdownloader <- function(
data.list[["EMP_Macro"]] <- zoo_EMP_Macro%>%
dplyr::mutate(SampleDate=lubridate::parse_date_time(.data$SampleDate, "%m/%d/%Y", tz="America/Los_Angeles"),
Datetime=lubridate::parse_date_time(dplyr::if_else(is.na(.data$Time), NA_character_, paste(.data$SampleDate, .data$Time)),
c("%Y-%m-%d %I:%M %p"), tz="Etc/GMT+8"), #create a variable for datetime
c("%Y-%m-%d %H:%M"), tz="Etc/GMT+8"), #create a variable for datetime
Datetime=lubridate::with_tz(.data$Datetime, "America/Los_Angeles"))%>% # Ensure everything ends up in local time
tidyr::pivot_longer(cols=c(-"SampleDate", -"Time", -"Datetime", -"StationNZ", -"Secchi", -"Chl_a", -"Temperature",
-"ECSurfacePreTow", -"ECBottomPreTow", -"Volume", -"Depth"),
Expand Down
20 changes: 20 additions & 0 deletions data-raw/EZ_stations.csv
Original file line number Diff line number Diff line change
Expand Up @@ -557,3 +557,23 @@ NZEZ6SJR,12/4/2023,38.02171,-121.8073
NZEZ2SJR,12/4/2023,38.04548,-121.6952
NZEZ2,12/6/2023,38.12078,-121.7008
NZEZ6,12/6/2023,38.07955,-121.7616
NZEZ2SJR,2024-01-03,38.03355,-121.7176
NZEZ6,2024-01-05,38.06473,-121.8441
NZEZ2,2024-01-05,38.06417,-121.7917
NZEZ2,2024-02-06,38.04848,-121.9154
NZEZ6,2024-02-06,38.05835,-121.9602
NZEZ6,2024-04-19,38.0598,-122.0023
NZEZ2,2024-04-19,38.05653,-121.9664
NZEZ6,2024-05-17,38.06454,-122.0364
NZEZ2,2024-06-17,38.0596,-121.9812
NZEZ6,2024-06-17,38.0596,-121.9812
NZEZ6,2024-07-16,38.04959,-121.9249
NZEZ2,2024-07-16,38.06318,-121.8238
NZEZ6,2024-08-16,38.04704,-121.8993
NZEZ2,2024-08-16,38.06195,-121.8165
NZEZ2,2024-09-13,38.0625,-121.8186
NZEZ6,2024-09-13,38.05059,-121.8825
NZEZ6,2024-10-10,38.06509,-121.8346
NZEZ2,2024-10-10,38.07302,-121.775
NZEZ6,2024-12-11,38.06281,-121.8228
NZEZ2,2024-12-11,38.07899,-121.7615
3 changes: 3 additions & 0 deletions data-raw/crosswalk-zoopComb-zoopEnvComb-startDates.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ zoopComb <- zoop$Zooplankton

zoopEnvComb <- zoop$Environment



startDates<-zoopComb%>%
dplyr::left_join(zoopEnvComb%>%
dplyr::select(Date, SampleID),
Expand All @@ -46,3 +48,4 @@ startDates<-zoopComb%>%

usethis::use_data(zoopComb, zoopEnvComb, startDates, crosswalk, overwrite = TRUE)


Loading
Loading