diff --git a/NAMESPACE b/NAMESPACE index aac8d9e5..a8d4f1f8 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -104,6 +104,7 @@ importFrom(plotly,layout) importFrom(plotly,plot_ly) importFrom(plotly,subplot) importFrom(reactable,colDef) +importFrom(rnoaa,ncdc) importFrom(stats,ecdf) importFrom(stats,lm) importFrom(stats,median) diff --git a/R/anlz_hydroload.R b/R/anlz_hydroload.R index 5baadb4a..e66d3508 100644 --- a/R/anlz_hydroload.R +++ b/R/anlz_hydroload.R @@ -7,12 +7,14 @@ #' @param trace logical indicating if function progress is printed in the consol #' #' @details -#' This function uses rainfall and streamflow data from NOAA and USGS and requires an API key. See the "Authentication" section under the help file for \code{\link[rnoaa]{ncdc}}. This key can be added to the R environment file and called for later use, see the examples. +#' This function uses rainfall and streamflow data from NOAA and USGS and requires an API key. See the "Authentication" section under the help file for ncdc in the defunct rnoaa package. This key can be added to the R environment file and called for later use, see the examples. #' #' These estimates are used in annual compliance assessment reports produced by the Tampa Bay Nitrogen Management Consortium. Load estimates and adjustment factors are based on regression models in https://drive.google.com/file/d/11NT0NQ2WbPO6pVZaD7P7Z6qjcwO1jxHw/view?usp=drivesdk #' #' @concept analyze #' +#' @importFrom rnoaa ncdc +#' #' @return A data frame with hydrological load estimates by bay segments for the requested years #' @export #' @@ -53,13 +55,13 @@ anlz_hydroload <- function(yrs, noaa_key = NULL, trace = FALSE){ end <- paste0(yr, "-12-31") # download NOAA UWS rainfall station data - sp_rainfall <- rnoaa::ncdc(datasetid = "GHCND", stationid = "GHCND:USW00092806", + sp_rainfall <- ncdc(datasetid = "GHCND", stationid = "GHCND:USW00092806", datatypeid = "PRCP", startdate = start, enddate = end, limit = 500, add_units = TRUE, token = noaa_key) sp_rain <- sp_rainfall$data %>% dplyr::summarise(sum = sum(value)/254) - tia_rainfall <- rnoaa::ncdc(datasetid = "GHCND", stationid = "GHCND:USW00012842", + tia_rainfall <- ncdc(datasetid = "GHCND", stationid = "GHCND:USW00012842", datatypeid = "PRCP", startdate = start, enddate = end, limit = 500, add_units = TRUE, token = noaa_key) tia_rain <- tia_rainfall$data %>% diff --git a/R/globalVariables.R b/R/globalVariables.R index 4b5ba216..6d65efdd 100644 --- a/R/globalVariables.R +++ b/R/globalVariables.R @@ -69,7 +69,7 @@ globalVariables(c("Chlorophyll_aQ", "Latitude", "Longitude", "SampleTime", "Samp "indnm", "brk", "cls", "conc", "exced", "gmean", "MWQA", "station_tot", "sumgt400", "yearfac", "nyrs", "ActivityDepthHeightMeasure.MeasureUnitCode", "ActivityDepthHeightMeasure.MeasureValue", "chla_target", "chla_val", - "la_target", "la_val", "MonitoringLocationTypeName")) + "la_target", "la_val", "MonitoringLocationTypeName", "loadest", "out1")) #' @importFrom grDevices rgb NULL diff --git a/man/anlz_hydroload.Rd b/man/anlz_hydroload.Rd index 45108fa6..d3be9aed 100644 --- a/man/anlz_hydroload.Rd +++ b/man/anlz_hydroload.Rd @@ -20,7 +20,7 @@ A data frame with hydrological load estimates by bay segments for the requested Estimate hydrological estimates and adjustment factors for bay segments } \details{ -This function uses rainfall and streamflow data from NOAA and USGS and requires an API key. See the "Authentication" section under the help file for \code{\link[rnoaa]{ncdc}}. This key can be added to the R environment file and called for later use, see the examples. +This function uses rainfall and streamflow data from NOAA and USGS and requires an API key. See the "Authentication" section under the help file for ncdc in the defunct rnoaa package. This key can be added to the R environment file and called for later use, see the examples. These estimates are used in annual compliance assessment reports produced by the Tampa Bay Nitrogen Management Consortium. Load estimates and adjustment factors are based on regression models in https://drive.google.com/file/d/11NT0NQ2WbPO6pVZaD7P7Z6qjcwO1jxHw/view?usp=drivesdk }