dataRetrieval
This R package is designed to obtain USGS or EPA water quality sample data, streamflow data, and metadata directly from web services.
Science Score: 57.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 7 DOI reference(s) in README -
○Academic publication links
-
✓Committers with academic emails
15 of 29 committers (51.7%) from academic institutions -
✓Institutional organization owner
Organization doi-usgs has institutional domain (www.usgs.gov) -
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.7%) to scientific vocabulary
Keywords
r
r-package
rstats
usgs
Keywords from Contributors
geo-data-portal
grid-data
genomics
dynamics
transformers
ecology
unit-testing
documentation-tool
autograd
annotation
Last synced: 6 months ago
·
JSON representation
Repository
This R package is designed to obtain USGS or EPA water quality sample data, streamflow data, and metadata directly from web services.
Basic Info
- Host: GitHub
- Owner: DOI-USGS
- License: other
- Language: R
- Default Branch: main
- Homepage: https://doi-usgs.github.io/dataRetrieval/
- Size: 49.2 MB
Statistics
- Stars: 304
- Watchers: 31
- Forks: 92
- Open Issues: 4
- Releases: 61
Topics
r
r-package
rstats
usgs
Created about 13 years ago
· Last pushed 6 months ago
Metadata Files
Readme
Changelog
License
README.Rmd
---
title: "README"
output:
md_document:
variant: gfm
editor_options:
chunk_output_type: console
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/",
warning = FALSE,
message = FALSE,
fig.height = 7,
fig.width = 7
)
library(dataRetrieval)
```
# dataRetrieval
[](https://cran.r-project.org/package=EGRET)
[](https://cran.r-project.org/package=dataRetrieval)
[](https://cran.r-project.org/package=dataRetrieval)
The `dataRetrieval` package was created to simplify the process of loading hydrologic data into the R environment. It is designed to retrieve the major data types of U.S. Geological Survey (USGS) hydrology data that are available on the Web, as well as data from the Water Quality Portal (WQP), which currently houses water quality data from the Environmental Protection Agency (EPA), U.S. Department of Agriculture (USDA), and USGS.
# Introduction
:warning: NWIS web services (readNWIS functions) will be replaced over time by USGS Water Data APIs (read_waterdata_). Read more about it here:
:warning: USGS discrete water-quality data availability and format are changing. To view the status of changes in data availability and code functionality, visit:
If you have additional questions about these changes, email CompTools@usgs.gov.
# What would you like to do?
1. Get instantaneous USGS data (for example, discharge sensor data). Start here: `?readNWISuv`
2. Get daily USGS data (for example, mean daily discharge). Start here: `?read_waterdata_daily`
3. Get discrete USGS groundwater data. Start here: `?read_waterdata_field_measurements`
4. Get discrete water quality data from a cooperative service that integrates publicly available water-quality data from the USGS, EPA, and over 400 state, federal, tribal, and local agencies. Start here: `?readWQPdata`
5. Get USGS discrete water quality data. Start here: `?read_waterdata_samples`
6. Get metadata about USGS time series data, including instantaneous and daily data. Start here: `?read_waterdata_ts_meta`
7. Find Hydro Network-Linked Data Index (NLDI) data. Start here: `?findNLDI`
For additional tutorials, see:
[Basic Tutorial](https://doi-usgs.github.io/dataRetrieval/articles/tutorial.html)
[dataRetrieval Introduction 1](https://rconnect.usgs.gov/dataRetrieval_workshop)
[dataRetrieval Introduction 2](https://rconnect.usgs.gov/NMC_dataRetrieval_2)
# Installation of dataRetrieval
To install the `dataRetrieval` package, you must be using R 3.0 or greater and run the following command:
```{r eval=FALSE}
install.packages("dataRetrieval")
```
# New USGS data access
The USGS is planning to modernize all web services in the near future. For each of these updates, `dataRetrieval` will create a new function to access the new services.
## API Token
You can register an API key for use with USGS water data APIs. There are now limits on how many queries can be requested per IP address per hour. If you find yourself running into limits, you can request an API token here:
Then save your token in your .Renviron file like this:
```
API_USGS_PAT = "my_super_secret_token"
```
You can use `usethis::edit_r_environ()` to edit find and open your .Renviron file. You will need to restart R for that variable to be recognized.
## New Features
### Style
New functions will use a "snake case", such as "read_waterdata_samples". Older functions use camel case, such as "readNWISdv". The difference is the underscore between words. This should be a handy way to tell the difference between newer modern data access, and the older traditional functions.
### Structure
Historically, we allowed users to customize their queries via the `...` argument structure. With `...`, users needed to know the exact names of query parameters before using the function. Now, the new functions will include **ALL** possible arguments that the web service APIs support. This will allow users to use tab-autocompletes (available in RStudio and other IDEs). **Users will need to understand that it is not advisable to specify all of these parameters. The systems can get bogged down with redundant query parameters.** We expect this will be easier for users, but it might take some time to smooth out the documentation and test usability. There may be additional consequences, such as users won't be able to build up argument lists to pass into the function.
### Dependencies
As we develop functions for the modern USGS Water Data APIs, we'll continue to explore updating package dependencies.
### Developmental workflow
CRAN-stable documentation will be available on the GitHub pages:
In-development documentation will be available on the USGS GitLab pages:
Development of `dataRetrieval` will happen on a git branch called "develop". The "develop" branch will only move to the "main" branch when we submit to CRAN, unless there are bug fixes that pertain to the CRAN release. The "develop" branch WILL change frequently, and there are no promises of future behavior. Users must accept that they are using those functions at their own risk. If you willing to accept this risk, the installation instructions are:
```{r eval=FALSE}
library(remotes)
install_github("DOI-USGS/dataRetrieval",
ref = "develop")
```
# Reporting bugs
Please consider reporting bugs and asking questions on the Issues page:
[https://github.com/DOI-USGS/dataRetrieval/issues](https://github.com/DOI-USGS/dataRetrieval/issues)
# Citations
## Citing the dataRetrieval package
```{r cite, eval=TRUE}
citation(package = "dataRetrieval")
```
## Citing NWIS data
U.S. Geological Survey, 2023, National Water Information System data available on the World Wide Web (USGS Water Data for the Nation), accessed [April 26, 2023], at http://waterdata.usgs.gov/nwis/. http://dx.doi.org/10.5066/F7P55KJN
This can be done using the `create_NWIS_bib` function:
```{r}
dv <- readNWISdv("09010500", "00060")
NWIScitation <- create_NWIS_bib(dv)
NWIScitation
print(NWIScitation, style = "Bibtex")
```
## Citing WQP data
Citations for specific datasets should use this format:
National Water Quality Monitoring Council, YYYY, Water Quality Portal, accessed mm, dd, yyyy, hyperlink_for_query, https://doi.org/10.5066/P9QRKUVJ.
This can be done using the `create_WQP_bib` function:
```{r}
SC <- readWQPqw(siteNumbers = "USGS-05288705",
parameterCd = "00300")
WQPcitation <- create_WQP_bib(SC)
WQPcitation
print(WQPcitation, style = "Bibtex")
```
## Citing Water Quality Portal itself
General Water Quality Portal citations should use the following:
Water Quality Portal. Washington (DC): National Water Quality Monitoring Council, United States Geological Survey (USGS), Environmental Protection Agency (EPA); 2021. https://doi.org/10.5066/P9QRKUVJ.
# Package Support
The Water Mission Area of the USGS supports the development and maintenance of `dataRetrieval`, and most likely further into the future. Resources are available primarily for maintenance and responding to user questions. Priorities on the development of new features are determined by the `dataRetrieval` development team.
```{r disclaimer, child="DISCLAIMER.md", eval=TRUE}
```
Owner
- Name: U.S. Geological Survey
- Login: DOI-USGS
- Kind: organization
- Email: gs_help_git@usgs.gov
- Location: United States of America
- Website: https://www.usgs.gov/
- Twitter: USGS
- Repositories: 59
- Profile: https://github.com/DOI-USGS
By integrating our diverse scientific expertise, we understand complex natural science phenomena and provide scientific products that lead to solutions.
GitHub Events
Total
- Create event: 2
- Issues event: 19
- Release event: 1
- Watch event: 33
- Issue comment event: 63
- Push event: 60
- Pull request review event: 120
- Pull request review comment event: 112
- Pull request event: 118
- Fork event: 8
Last Year
- Create event: 2
- Issues event: 19
- Release event: 1
- Watch event: 33
- Issue comment event: 63
- Push event: 60
- Pull request review event: 120
- Pull request review comment event: 112
- Pull request event: 118
- Fork event: 8
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Laura DeCicco | l****o@u****v | 2,123 |
| wdwatkins | w****s@u****v | 135 |
| Lindsay Carr | l****r@u****v | 48 |
| mike | j****0@u****u | 25 |
| David Blodgett | d****t@u****v | 13 |
| Krall | a****l@u****v | 11 |
| Jessica Thompson | j****s@u****v | 9 |
| Jordan S Read | j****d@u****v | 8 |
| Elise Hinman | e****n@u****v | 8 |
| Julie Padilla | p****0@g****m | 7 |
| Doug Friedman | s****b@g****m | 6 |
| Jordan Walker | j****r@u****v | 6 |
| elbeejay | j****n@u****v | 6 |
| jsta | s****2@m****u | 5 |
| Lee Stanish | 8****s | 5 |
| matt rhoads | m****1@g****m | 2 |
| Jerry Martin | A****t | 2 |
| jwpestrak | j****k | 1 |
| dependabot[bot] | 4****] | 1 |
| cristinamullin | 4****n | 1 |
| Padilla | J****a@s****v | 1 |
| Kevin M. Smith | K****h@t****u | 1 |
| Katrin Leinweber | 9****r | 1 |
| Jim Hester | j****r@g****m | 1 |
| David Blodgett | 1 | |
| unknown | l****o@I****t | 1 |
| Hadley Wickham | h****m@g****m | 1 |
| Bryan McCloskey | b****y@u****v | 1 |
| Alison Appling | a****g@u****v | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 120
- Total pull requests: 239
- Average time to close issues: 9 months
- Average time to close pull requests: 3 days
- Total issue authors: 71
- Total pull request authors: 14
- Average comments per issue: 2.73
- Average comments per pull request: 0.46
- Merged pull requests: 219
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 14
- Pull requests: 127
- Average time to close issues: about 2 months
- Average time to close pull requests: 3 days
- Issue authors: 13
- Pull request authors: 5
- Average comments per issue: 1.86
- Average comments per pull request: 0.6
- Merged pull requests: 110
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- ldecicco-USGS (26)
- jmusgs (7)
- dblodgett-usgs (4)
- lstanish-usgs (4)
- lindsayplatt (4)
- jordansread (3)
- ehinman (3)
- fhmejia (2)
- Katianagr (2)
- mps9506 (2)
- KB-NJGWS (2)
- nrlottig (2)
- mkoohafkan (2)
- jkreft-usgs (2)
- jennymurphy (1)
Pull Request Authors
- ldecicco-USGS (233)
- dblodgett-usgs (12)
- ehinman (4)
- mikejohnson51 (4)
- alkrall (3)
- jsta (3)
- elbeejay (3)
- cristinamullin (2)
- jpadilla-spu (2)
- lstanish-usgs (2)
- padilla410 (1)
- jimhester (1)
- hadley (1)
- rckwzrd (1)
Top Labels
Issue Labels
bug (42)
question (37)
enhancement (30)
Backlog (8)
Pull Request Labels
Packages
- Total packages: 3
-
Total downloads:
- cran 4,365 last-month
- Total docker downloads: 42,194
-
Total dependent packages: 10
(may contain duplicates) -
Total dependent repositories: 50
(may contain duplicates) - Total versions: 132
- Total maintainers: 1
proxy.golang.org: github.com/doi-usgs/dataretrieval
- Documentation: https://pkg.go.dev/github.com/doi-usgs/dataretrieval#section-documentation
- License: other
-
Latest release: v2.7.19+incompatible
published 8 months ago
Rankings
Dependent packages count: 5.5%
Average: 5.6%
Dependent repos count: 5.8%
Last synced:
6 months ago
proxy.golang.org: github.com/DOI-USGS/dataRetrieval
- Documentation: https://pkg.go.dev/github.com/DOI-USGS/dataRetrieval#section-documentation
- License: other
-
Latest release: v2.7.19+incompatible
published 8 months ago
Rankings
Dependent packages count: 5.5%
Average: 5.6%
Dependent repos count: 5.8%
Last synced:
6 months ago
cran.r-project.org: dataRetrieval
Retrieval Functions for USGS and EPA Hydrology and Water Quality Data
- Documentation: http://cran.r-project.org/web/packages/dataRetrieval/dataRetrieval.pdf
- License: CC0
-
Latest release: 2.7.21
published 7 months ago
Rankings
Dependent repos count: 3.5%
Dependent packages count: 5.3%
Downloads: 7.8%
Average: 10.6%
Docker downloads count: 25.8%
Maintainers (1)
Last synced:
6 months ago
Dependencies
DESCRIPTION
cran
- R >= 3.5.0 depends
- curl * imports
- httr >= 1.0.0 imports
- jsonlite * imports
- lubridate >= 1.5.0 imports
- readr >= 1.0.0 imports
- stats * imports
- utils * imports
- xml2 * imports
- DT * suggests
- covr * suggests
- dplyr * suggests
- ggplot2 * suggests
- gridExtra * suggests
- knitr * suggests
- rmarkdown * suggests
- sf * suggests
- testthat * suggests
.github/workflows/R-CMD-check.yaml
actions
- actions/checkout v3 composite
- r-lib/actions/check-r-package v2 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml
actions
- JamesIves/github-pages-deploy-action v4.4.1 composite
- actions/checkout v3 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/style-and-lint.yaml
actions
- actions/cache v2 composite
- actions/checkout v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- stefanzweifel/git-auto-commit-action v4 composite
.github/workflows/test-coverage.yaml
actions
- actions/cache v1 composite
- actions/checkout v2 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite