/
readNWISgwl.Rd
87 lines (80 loc) · 3.87 KB
/
readNWISgwl.Rd
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/readNWISunit.R
\name{readNWISgwl}
\alias{readNWISgwl}
\title{Groundwater level measurements retrieval from USGS (NWIS)}
\usage{
readNWISgwl(
siteNumbers,
startDate = "",
endDate = "",
parameterCd = NA,
convertType = TRUE,
tz = "UTC"
)
}
\arguments{
\item{siteNumbers}{character USGS site number (or multiple sites). This is usually an 8 digit number}
\item{startDate}{character starting date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates
retrieval for the earliest possible record.}
\item{endDate}{character ending date for data retrieval in the form YYYY-MM-DD. Default is "" which indicates
retrieval for the latest possible record.}
\item{parameterCd}{character USGS parameter code. This is usually an 5 digit number. Default is "".}
\item{convertType}{logical, defaults to \code{TRUE}. If \code{TRUE}, the
function will convert the data to dates, datetimes,
numerics based on a standard algorithm. If false, everything is returned as a character}
\item{tz}{character to set timezone attribute of dateTime. Default is "UTC", and converts the
date times to UTC, properly accounting for daylight savings times based on the data's provided tz_cd column.
Possible values to provide are "America/New_York", "America/Chicago", "America/Denver", "America/Los_Angeles",
"America/Anchorage", as well as the following which do not use daylight savings time: "America/Honolulu",
"America/Jamaica", "America/Managua", "America/Phoenix", and "America/Metlakatla". See also \code{OlsonNames()}
for more information on time zones.}
}
\value{
A data frame with the following columns:
\tabular{lll}{
Name \tab Type \tab Description \cr
agency_cd \tab character \tab The NWIS code for the agency reporting the data\cr
site_no \tab character \tab The USGS site number \cr
site_tp_cd \tab character \tab Site type code \cr
lev_dt \tab Date \tab Date level measured\cr
lev_tm \tab character \tab Time level measured \cr
lev_tz_cd \tab character \tab Time datum \cr
lev_va \tab numeric \tab Water level value in feet below land surface\cr
sl_lev_va \tab numeric \tab Water level value in feet above specific vertical datum \cr
lev_status_cd \tab character \tab The status of the site at the time the water level was measured \cr
lev_agency_cd \tab character \tab The agency code of the person measuring the water level \cr
}
There are also several useful attributes attached to the data frame:
\tabular{lll}{
Name \tab Type \tab Description \cr
url \tab character \tab The url used to generate the data \cr
queryTime \tab POSIXct \tab The time the data was returned \cr
comment \tab character \tab Header comments from the RDB file \cr
siteInfo \tab data.frame \tab A data frame containing information on the requested sites \cr
}
}
\description{
Reads groundwater level measurements from NWISweb. Mixed date/times come back from the service
depending on the year that the data was collected. See \url{https://waterdata.usgs.gov/usa/nwis/gw}
for details about groundwater. By default the returned dates are converted to date objects, unless convertType
is specified as FALSE. Sites with non-standard date formats (i.e. lacking a day) can be affected (see examples).
See \url{https://waterservices.usgs.gov/docs/groundwater-levels/} for more information.
}
\examples{
\dontshow{if (is_dataRetrieval_user()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf}
site_id <- "434400121275801"
\donttest{
data <- readNWISgwl(site_id)
sites <- c("434400121275801", "375907091432201")
data2 <- readNWISgwl(site_id, "", "")
data3 <- readNWISgwl("420125073193001", "", "")
# handling of data where date has no day
data4 <- readNWISgwl("425957088141001", startDate = "1980-01-01")
data5 <- readNWISgwl("263819081585801", parameterCd = "72019")
}
\dontshow{\}) # examplesIf}
}
\seealso{
\code{\link{constructNWISURL}}, \code{\link{importRDB1}}
}