forked from DOI-USGS/dataRetrieval
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
150 lines (94 loc) · 5.24 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
---
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 <img src="man/figures/hex_logo.png" class="logo" alt="dataRetrieval" style="width:90px;height:auto;" align="right" />
[![CRAN version](http://www.r-pkg.org/badges/version/dataRetrieval)](https://cran.r-project.org/package=EGRET)
[![](http://cranlogs.r-pkg.org/badges/dataRetrieval)](https://cran.r-project.org/package=dataRetrieval)
[![](http://cranlogs.r-pkg.org/badges/grand-total/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. Direct USGS data is obtained from a service called the National Water Information System (NWIS).
:warning: USGS discrete water-quality data availability and format are changing. Beginning March 11, 2024 USGS data obtained from legacy services will not include new USGS data or recent updates to existing data. To view the status of changes in data availability and code functionality, visit: <https://doi-usgs.github.io/dataRetrieval/articles/Status.html>
:warning: All documentation on <https://doi-usgs.github.io/dataRetrieval> assume you have the development version of dataRetrieval installed. To do that:
```{r eval=FALSE}
library(remotes)
install_github("DOI-USGS/dataRetrieval",
build_vignettes = TRUE,
build_opts = c("--no-resave-data",
"--no-manual"))
```
If you have additional questions about these changes, email CompTools@usgs.gov.
# What would you like to do?
1. Get instantaneous USGS discharge data. Start here: `?readNWISuv`
2. Get daily USGS discharge data. Start here: `?readNWISdv`
3. Get USGS groundwater data. Start here: `?readNWISgwl`
4. Get discrete water quality data. Start here: `?readWQPdata`
4. Discover USGS data (not including discrete water quality data). Start here: `?whatNWISdata`
6. 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/NMC_dataRetrieval_1)
[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")
```
To get cutting-edge changes, install from GitHub using the `remotes` packages:
```{r eval=FALSE}
library(remotes)
install_github("DOI-USGS/dataRetrieval",
build_vignettes = TRUE,
build_opts = c("--no-resave-data",
"--no-manual"))
```
# 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. This software was last released with USGS record: IP-147158.
```{r disclaimer, child="DISCLAIMER.md", eval=TRUE}
```