Learn R Programming

dataRetrieval (version 1.4.0)

getRDB1Data: Function to return data from the NWIS RDB 1.0 format

Description

This function accepts a url parameter that already contains the desired NWIS site, parameter code, statistic, startdate and enddate.

Usage

getRDB1Data(obs_url, asDateTime = FALSE, qw = FALSE)

Arguments

obs_url

string containing the url for the retrieval

asDateTime

logical, if TRUE returns date and time as POSIXct, if FALSE, Date

qw

logical, if TRUE parses as water quality data (where dates/times are in start and end times)

Value

data a data frame containing columns agency, site, dateTime, values, and remark codes for all requested combinations

Examples

Run this code
# NOT RUN {
siteNumber <- "02177000"
startDate <- "2012-09-01"
endDate <- "2012-10-01"
offering <- "00003"
property <- "00060"
obs_url <- constructNWISURL(siteNumber,property,
         startDate,endDate,"dv",format="tsv")
data <- getRDB1Data(obs_url)
urlMulti <- constructNWISURL("04085427",c("00060","00010"),
         startDate,endDate,"dv",statCd=c("00003","00001"),"tsv")
multiData <- getRDB1Data(urlMulti)
unitDataURL <- constructNWISURL(siteNumber,property,
         "2014-10-10","2014-10-10","uv",format="tsv")
unitData <- getRDB1Data(unitDataURL, asDateTime=TRUE)
# }

Run the code above in your browser using DataLab