Skip to content
Open
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
3 changes: 3 additions & 0 deletions R/readWQPdata.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
#' Sampling Activity \tab ActivityWQX3 \tab /wqx3/Activity/search \cr
#' }
#'
#' If you experience unexpected errors, check the

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you are changing the roxygen stuff, there should be an updated .Rd file pushed as well. THAT BEING SAID... CRAN gets really angry if urls provided in the help pages break or have a redirect. I'm a hesitant to add this link here - I don't know how often rconnect.usgs.gov goes down for maintenance or other reasons. Or, we could add the link here (so it shows up on the package documentation), but just remember to take it out on the submitted CRAN package (?)

#' [WQP Status Page](https://rconnect.usgs.gov/wqp-status/) for current
#' service health information.
#'
#' @param \dots see <https://www.waterqualitydata.us/webservices_documentation> for a complete list of options.
#' A list of arguments can also be supplied. For more information see the above
Expand Down
2 changes: 1 addition & 1 deletion tutorials/basic_slides_deck.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tutorials/changes_slides_deck.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tutorials/quick_intro_deck.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion vignettes/Contributing.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
90 changes: 54 additions & 36 deletions vignettes/Status.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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]"
```

Expand All @@ -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
Expand All @@ -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.
Expand Down
Loading