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
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- Jungbluth, M. J., J. Burns, L. Grimaldo, A. Slaughter, A. Katla, and W. Kimmerer. 2021. Feeding habits and novel prey of larval fishes in the northern San Francisco Estuary. Environmental DNA.1-22. <https://doi.org/10.1002/edn3.226>
- Fixed issue where macrozoop biomass was being incorrectly converted to micrograms, resulting in 100X higher biomass values.
- Added FRP 2022 data and adjusted crosswalk to reflect changes to their taxonomic table.
- Added 2023 FMWT/STN data and adjusted zoopdownloader to reflect new date format

# zooper 2.5.1

Expand Down
18 changes: 13 additions & 5 deletions R/zoop_downloader.R
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,11 @@ Zoopdownloader <- function(
Crangonyx_sp="d", Gammarus_daiberi="d", Grandidierella_japonica="d",
Hyalella_sp="d", Unidentified_Amphipod="d", Unidentified_Corophium="d",
Unidentified_Gammarus="d"))%>%
dplyr::mutate(ID=paste(.data$Year, .data$Project, .data$Survey, .data$Station))
dplyr::mutate(ID=paste(.data$Year, .data$Project, .data$Survey, .data$Station)) %>%
dplyr::mutate(Datetime = lubridate::parse_date_time(dplyr::if_else(is.na(.data$Time), NA_character_,
paste(.data$Date, .data$Time)), "%Y-%m-%d %H:%M", tz="America/Los_Angeles"),
Date=lubridate::parse_date_time(.data$Date, "%Y-%m-%d", tz="America/Los_Angeles"))
#The 2025 data upload has a new date format for Macro (but not meso, and not SMSCG very annoying)

zoo_SMSCG_Macro <- readr::read_csv(file.path(Data_folder, "SMSCG_Macro.csv"),
col_types=readr::cols_only(Project="c", Year="d", Survey="d",
Expand All @@ -1021,13 +1025,17 @@ Zoopdownloader <- function(
Hyalella_sp="d", Unidentified_Amphipod="d", Unidentified_Corophium="d",
Unidentified_Gammarus="d"))%>%
dplyr::mutate(ID=paste(.data$Year, .data$Project, .data$Survey, .data$Station))%>%
dplyr::filter(!.data$ID%in%unique(zoo_FMWT_Macro$ID) & .data$Project%in%c("FMWT", "STN"))
dplyr::filter(!.data$ID%in%unique(zoo_FMWT_Macro$ID) & .data$Project%in%c("FMWT", "STN")) %>%

#put date and time in the right format. Date first, tehn datetime to try and fix a problem where the date randomly came out wrong in the 'datetime' version
dplyr::mutate(Date=lubridate::parse_date_time(.data$Date, "%m/%d/%y", tz="America/Los_Angeles"),
Datetime = lubridate::parse_date_time(dplyr::if_else(is.na(.data$Time), NA_character_,
paste(.data$Date, .data$Time)), "%Y-%m-%d %H:%M:%S", tz="America/Los_Angeles"))

data.list[["FMWT_Macro"]] <- dplyr::bind_rows(zoo_FMWT_Macro, zoo_SMSCG_Macro)%>%
dplyr::select(-"ID")%>%
dplyr::mutate(Datetime = lubridate::parse_date_time(dplyr::if_else(is.na(.data$Time), NA_character_, paste(.data$Date, .data$Time)), "%m/%d/%Y %H:%M", tz="America/Los_Angeles"),
Date=lubridate::parse_date_time(.data$Date, "%m/%d/%Y", tz="America/Los_Angeles"),
Microcystis = as.character(.data$Microcystis))%>% #create a variable for datetime
distinct()%>% #remove any samples duplicated between the SMSCG datset and the FMWTdataset
dplyr::mutate(Microcystis = as.character(.data$Microcystis))%>%
tidyr::pivot_longer(cols=c(-"Project", -"Year", -"Survey", -"Date", -"Datetime",
-"Station", -"Time", -"TideCode",
-"DepthBottom", -"CondSurf", -"CondBott",
Expand Down
2 changes: 2 additions & 0 deletions data-raw/crosswalk-zoopComb-zoopEnvComb-startDates.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ zoop<-Zoopdownloader(Data_sets=c("EMP_Meso", "FMWT_Meso", "STN_Meso",
Data_folder=tempdir(), Save_object=FALSE, Return_object=TRUE,
Redownload_data=TRUE, Crosswalk=crosswalk, Biomass=TRUE)


zoopComb <- zoop$Zooplankton

zoopEnvComb <- zoop$Environment
Expand All @@ -45,3 +46,4 @@ startDates<-zoopComb%>%
dplyr::summarise(Startdate = min(Date), .groups="drop")

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

Binary file modified data/crosswalk.rda
Binary file not shown.
Binary file modified data/startDates.rda
Binary file not shown.
Binary file modified data/zoopComb.rda
Binary file not shown.
Binary file modified data/zoopEnvComb.rda
Binary file not shown.
Loading