diff --git a/R/readWQPdata.R b/R/readWQPdata.R index 3f65c626..92c1bd40 100644 --- a/R/readWQPdata.R +++ b/R/readWQPdata.R @@ -40,6 +40,9 @@ #' Sampling Activity \tab ActivityWQX3 \tab /wqx3/Activity/search \cr #' } #' +#' If you experience unexpected errors, check the +#' [WQP Status Page](https://rconnect.usgs.gov/wqp-status/) for current +#' service health information. #' #' @param \dots see for a complete list of options. #' A list of arguments can also be supplied. For more information see the above diff --git a/tutorials/basic_slides_deck.qmd b/tutorials/basic_slides_deck.qmd index 05002d31..84d506a9 100644 --- a/tutorials/basic_slides_deck.qmd +++ b/tutorials/basic_slides_deck.qmd @@ -505,7 +505,7 @@ Sys.getenv("API_USGS_PAT") ``` ::: {.callout-note collapse="true"} -Your .Renviorn file should never be pushed to a public repository. +Your .Renviron file should never be pushed to a public repository. ::: ### Python: Project diff --git a/tutorials/changes_slides_deck.qmd b/tutorials/changes_slides_deck.qmd index f69181d5..a1d7f972 100644 --- a/tutorials/changes_slides_deck.qmd +++ b/tutorials/changes_slides_deck.qmd @@ -290,7 +290,7 @@ Sys.getenv("API_USGS_PAT") ``` ::: {.callout-note collapse="true"} -Your .Renviorn file should never be pushed to a public repository. +Your .Renviron file should never be pushed to a public repository. ::: ### Python diff --git a/tutorials/quick_intro_deck.qmd b/tutorials/quick_intro_deck.qmd index 05a75e82..a0a3383e 100644 --- a/tutorials/quick_intro_deck.qmd +++ b/tutorials/quick_intro_deck.qmd @@ -303,7 +303,7 @@ Biggest changes: 2. Save it in a safe place (KeePass or other password management tool) -3. Add it to your .Renviorn file as API_USGS_PAT. +3. Add it to your .Renviron file as API_USGS_PAT. 4. Restart R diff --git a/vignettes/Contributing.Rmd b/vignettes/Contributing.Rmd index 1c528253..0f569fe3 100644 --- a/vignettes/Contributing.Rmd +++ b/vignettes/Contributing.Rmd @@ -398,7 +398,7 @@ Then activate the environment (still in Miniforge) using `conda`: ``` conda activate pyclass ``` -The slides will use the R package `reticulate` to manage flipping back and forth between R and Python. To help `reticulate` know where Python is installed, you will need to add an envionmnental variable to your .Renviorn file "RETICULATE_PYTHON". Run `usethis::edit_r_environ()`, then add the path to your Python installation, and restart R. RStudio can render both the R and Python in the Quarto slides. However, if you want to do troubleshooting on individual code chunks, you might want to switch to Positron which allows seamless transition between R and Python consoles. +The slides will use the R package `reticulate` to manage flipping back and forth between R and Python. To help `reticulate` know where Python is installed, you will need to add an envionmnental variable to your .Renviron file "RETICULATE_PYTHON". Run `usethis::edit_r_environ()`, then add the path to your Python installation, and restart R. RStudio can render both the R and Python in the Quarto slides. However, if you want to do troubleshooting on individual code chunks, you might want to switch to Positron which allows seamless transition between R and Python consoles. Let's say you need to update to a new version of dataretrieval: diff --git a/vignettes/Status.Rmd b/vignettes/Status.Rmd index 4893570f..be0f6fa0 100644 --- a/vignettes/Status.Rmd +++ b/vignettes/Status.Rmd @@ -59,27 +59,34 @@ df <- data.frame( "`read_waterdata_field_measurements`", "`read_waterdata_field_measurements`, `read_waterdata_channel`", "`read_waterdata`", - "`read_waterdata_continuous`", + "`read_waterdata_continuous`", "`read_waterdata_rating`", #rating "`read_waterdata_stats_por`, `read_waterdata_stats_daterange`", "`read_waterdata_peaks`", "`read_wateruse`", "`read_waterdata_ts_meta`, `read_waterdata_field_meta`, `read_waterdata_combined_meta`" ), - "Available on (branch)" = c(rep("main (CRAN)", 6), - "main (CRAN)", - "main (CRAN)", - "main (CRAN)", - "main", - "main (CRAN)", - "main", - "develop", - "main (CRAN)") - + "Available on (branch)" = c( + rep("main (CRAN)", 6), + "main (CRAN)", + "main (CRAN)", + "main (CRAN)", + "main", + "main (CRAN)", + "main", + "develop", + "main (CRAN)" + ) ) -knitr::kable(df, col.names = c("WaterServices (legacy) function", "Water Data (new) function", "Available on (branch name)")) - +knitr::kable( + df, + col.names = c( + "WaterServices (legacy) function", + "Water Data (new) function", + "Available on (branch name)" + ) +) ``` If you want to learn more about the new water data APIs, check out the ["What's new with WDFN APIs?" blog post](https://waterdata.usgs.gov/blog/api-whats-new-wdfn-apis/), as well as the [documentation](https://api.waterdata.usgs.gov/docs/) available on api.waterdata.usgs.gov. @@ -90,7 +97,7 @@ Do you regularly use `dataRetrieval`? As you switch your workflows over to the n One you have your API key, add it to your `.Renviron` file like this: -```{r} +``` API_USGS_PAT = "[your api key]" ``` @@ -116,26 +123,33 @@ Read more about it in the vignette, [Introducing read_waterdata_samples](https:/ `dataRetrieval` WQP functions continue to default to the legacy system (that does not include post-March 2024 USGS discrete sample data). The new replacement services aren't currently set as the default because the WQP team still considers these services "beta", and therefore performance is not guaranteed. Users may encounter bugs or identify issues with the implementation of the new services: we welcome (and encourage!) your feedback to help improve these offerings, just send an email to WQX@epa.gov. +For real-time information on WQP service availability, visit the [WQP Status Page](https://rconnect.usgs.gov/wqp-status/). The status page shows the success/failure of a set of test queries to both the legacy and beta WQP services, updated every 10 minutes. + The table below provides a summary of the current state of WQP functions in `dataRetrieval`. ```{r echo=FALSE} -df <- data.frame(Function = c("readWQPdata", - "readWQPqw", - "whatWQPsites", - "whatWQPmetrics", - "whatWQPsamples", - "whatWQPdata", - "readWQPsummary", - "whatNWISdata"), - Status = c("Set to legacy options by default. WQX3 options available.", - "Set to legacy options by default. WQX3 options available.", - "Set to legacy options by default. WQX3 options available.", - rep("Currently only available via legacy services.", 3), - "Does not have accurate information for USGS data.", - "Does not have accurate information for qw data.")) +df <- data.frame( + Function = c( + "readWQPdata", + "readWQPqw", + "whatWQPsites", + "whatWQPmetrics", + "whatWQPsamples", + "whatWQPdata", + "readWQPsummary", + "whatNWISdata" + ), + Status = c( + "Set to legacy options by default. WQX3 options available.", + "Set to legacy options by default. WQX3 options available.", + "Set to legacy options by default. WQX3 options available.", + rep("Currently only available via legacy services.", 3), + "Does not have accurate information for USGS data.", + "Does not have accurate information for qw data." + ) +) knitr::kable(df) - ``` ### Leveraging the beta WQP services @@ -155,18 +169,22 @@ The beta WQP offers data in the "WQX version 3.0 format" (WQX = [Water Quality E If you wish to leverage a specific "ResultWQX3" data profile using the beta services, your code might look something like this, using the very flexible `readWQPdata` function: ```{r, eval = FALSE} -data_full <- readWQPdata(siteid = "USGS-04024315", - characteristicName = "pH", - dataProfile = "fullPhysChem", - service = "ResultWQX3") +data_full <- readWQPdata( + siteid = "USGS-04024315", + characteristicName = "pH", + dataProfile = "fullPhysChem", + service = "ResultWQX3" +) ``` On the other hand, the "StationWQX3" service requires no `dataProfile` argument: ```{r, eval = FALSE} -data_station <- readWQPdata(siteid = "USGS-04024315", - characteristicName = "pH", - service = "StationWQX3") +data_station <- readWQPdata( + siteid = "USGS-04024315", + characteristicName = "pH", + service = "StationWQX3" +) ``` Guidance on how to use the new web page and web services are available in the [User Guide](https://www.waterqualitydata.us/beta/portal_userguide/) and [Web Services Guide](https://www.waterqualitydata.us/beta/webservices_documentation/). Additional profiles will continue to be added over time.