Skip to contents

Imports data from NWIS web service. A list of parameter and statistic codes can be found here: https://help.waterdata.usgs.gov/codes-and-parameters For raw data, use readNWISqw from the dataRetrieval package. This function will retrieve the raw data, and compress it (summing constituents) if more than 1 parameter code is supplied. See section 3.2.4 of the vignette for more details.

Usage

readNWISSample(siteNumber, parameterCd, startDate = "", endDate = "",
  verbose = TRUE)

Arguments

siteNumber

character USGS site number. This is usually an 8 digit number

parameterCd

character USGS parameter code. This is usually an 5 digit number.

startDate

character starting date for data retrieval in the form YYYY-MM-DD. Default is empty quotes "" which will retrieve the full period of record.

endDate

character ending date for data retrieval in the form YYYY-MM-DD. Default is empty quotes "" which will retrieve the full period of record.

verbose

logical specifying whether or not to display progress message

Value

A data frame 'Sample' with the following columns:

NameTypeDescription
DateDateDate
ConcLownumericLower limit of concentration
ConcHighnumericUpper limit of concentration
UncenintegerUncensored data (1=TRUE, 0=FALSE)
ConcAvenumericAverage concentration
JulianintegerNumber of days since Jan. 1, 1850
MonthintegerMonth of the year [1-12]
DayintegerDay of the year [1-366]
DecYearnumericDecimal year
MonthSeqintegerNumber of months since January 1, 1850
SinDYnumericSine of the DecYear
CosDYnumericCosine of the DecYear

Examples

# \donttest{
# These examples require an internet connection to run

Sample_01075 <- readNWISSample('01594440','01075', '1985-01-01', '1985-03-31')
#> Warning: NWIS qw web services are being retired.
#> Please see vignette('qwdata_changes', package = 'dataRetrieval')
#> for more information.
#> https://cran.r-project.org/web/packages/dataRetrieval/vignettes/qwdata_changes.html
# }