From a9c9962a25a34c7899d24649636bb547edc03acd Mon Sep 17 00:00:00 2001 From: unknown <ldecicco@usgs.gov> Date: Mon, 3 Nov 2014 10:05:49 -0600 Subject: [PATCH] Updating help files. --- NAMESPACE | 4 ++-- man/importRDB1.Rd | 12 +++++++++--- man/importWQP.Rd | 7 ++++++- man/readNWISdv.Rd | 10 ++-------- man/readNWISgwl.Rd | 2 +- man/readNWISmeas.Rd | 9 +++++++-- man/readNWISpeak.Rd | 4 ++-- man/readNWISrating.Rd | 2 +- man/{readNWISunit.Rd => readNWISuv.Rd} | 15 ++++++++++----- 9 files changed, 40 insertions(+), 25 deletions(-) rename man/{readNWISunit.Rd => readNWISuv.Rd} (64%) diff --git a/NAMESPACE b/NAMESPACE index 7a473f0c..dc848130 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -15,7 +15,7 @@ export(readNWISpeak) export(readNWISqw) export(readNWISrating) export(readNWISsite) -export(readNWISunit) +export(readNWISuv) export(readWQPdata) export(readWQPqw) export(renameColumns) @@ -26,6 +26,6 @@ export(zeroPad) import(RCurl) import(XML) import(httr) +import(lubridate) import(reshape2) -importFrom(lubridate,parse_date_time) importFrom(plyr,rbind.fill.matrix) diff --git a/man/importRDB1.Rd b/man/importRDB1.Rd index f80c8bd5..2d2e830e 100644 --- a/man/importRDB1.Rd +++ b/man/importRDB1.Rd @@ -26,7 +26,8 @@ data a data frame containing columns agency, site, dateTime (converted to UTC), } \description{ This function accepts a url parameter that already contains the desired -NWIS site, parameter code, statistic, startdate and enddate. +NWIS site, parameter code, statistic, startdate and enddate. It is not +recommended to use the RDB format for importing multi-site data. } \examples{ siteNumber <- "02177000" @@ -37,9 +38,9 @@ property <- "00060" obs_url <- constructNWISURL(siteNumber,property, startDate,endDate,"dv",format="tsv") data <- importRDB1(obs_url) -urlMulti <- constructNWISURL("04085427",c("00060","00010"), +urlMultiPcodes <- constructNWISURL("04085427",c("00060","00010"), startDate,endDate,"dv",statCd=c("00003","00001"),"tsv") -multiData <- importRDB1(urlMulti) +multiData <- importRDB1(urlMultiPcodes) unitDataURL <- constructNWISURL(siteNumber,property, "2013-11-03","2013-11-03","uv",format="tsv") #includes timezone switch unitData <- importRDB1(unitDataURL, asDateTime=TRUE) @@ -47,6 +48,11 @@ qwURL <- constructNWISURL(c('04024430','04024000'), c('34247','30234','32104','34220'), "2010-11-03","","qw",format="rdb") qwData <- importRDB1(qwURL, qw=TRUE, tz="America/Chicago") +iceSite <- '04024430' +start <- "2013-11-09" +end <- "2013-11-28" +urlIce <- constructNWISURL(iceSite,"00060",start, end,"uv",format="tsv") + # User file: filePath <- system.file("extdata", package="dataRetrievaldemo") fileName <- "RDB1Example.txt" diff --git a/man/importWQP.Rd b/man/importWQP.Rd index 8b9da71e..f5faaee1 100644 --- a/man/importWQP.Rd +++ b/man/importWQP.Rd @@ -3,12 +3,17 @@ \alias{importWQP} \title{Basic Water Quality Portal Data grabber} \usage{ -importWQP(url, zip = FALSE) +importWQP(url, zip = FALSE, tz = "") } \arguments{ \item{url}{string URL to Water Quality Portal#'} \item{zip}{logical used to request the data in a zip format (TRUE)} + +\item{tz}{string to set timezone attribute of datetime. Default is an empty quote, which converts the +datetimes 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","America/Honolulu","America/Jamaica","America/Managua","America/Phoenix", and "America/Metlakatla"} } \value{ retval dataframe raw data returned from the Water Quality Portal. Additionally, a POSIXct dateTime column is supplied for diff --git a/man/readNWISdv.Rd b/man/readNWISdv.Rd index 13ba233b..203fbbf3 100644 --- a/man/readNWISdv.Rd +++ b/man/readNWISdv.Rd @@ -3,8 +3,8 @@ \alias{readNWISdv} \title{Raw Data Import for USGS NWIS Data} \usage{ -readNWISdv(siteNumber, parameterCd, startDate, endDate, statCd = "00003", - format = "tsv") +readNWISdv(siteNumber, parameterCd, startDate = "", endDate = "", + statCd = "00003") } \arguments{ \item{siteNumber}{string USGS site number. This is usually an 8 digit number. Multiple sites can be requested with a string vector.} @@ -16,10 +16,6 @@ readNWISdv(siteNumber, parameterCd, startDate, endDate, statCd = "00003", \item{endDate}{string ending date for data retrieval in the form YYYY-MM-DD.} \item{statCd}{string USGS statistic code. This is usually 5 digits. Daily mean (00003) is the default.} - -\item{format}{string, can be 'tsv' or 'xml', and is only applicable for daily and unit value requests. 'tsv' returns results faster, but there is a possiblitiy that an incomplete file is returned without warning. XML is slower, -but will offer a warning if the file was incomplete (for example, if there was a momentary problem with the internet connection). It is possible to safely use the 'tsv' option, -but the user must carefully check the results to see if the data returns matches what is expected. The default is 'tsv'.} } \value{ data dataframe with agency, site, dateTime, value, and code columns @@ -37,8 +33,6 @@ pCode <- '00060' rawDailyQ <- readNWISdv(siteNumber,pCode, startDate, endDate) rawDailyTemperature <- readNWISdv(siteNumber,'00010', startDate, endDate, statCd='00001') -rawDailyTemperatureTSV <- readNWISdv(siteNumber,'00010', - startDate, endDate, statCd='00001',format='tsv') rawDailyQAndTempMeanMax <- readNWISdv(siteNumber,c('00010','00060'), startDate, endDate, statCd=c('00001','00003')) rawDailyMultiSites<- readNWISdv(c("01491000","01645000"),c('00010','00060'), diff --git a/man/readNWISgwl.Rd b/man/readNWISgwl.Rd index 4eaf19ed..050dcd20 100644 --- a/man/readNWISgwl.Rd +++ b/man/readNWISgwl.Rd @@ -3,7 +3,7 @@ \alias{readNWISgwl} \title{Reads groundwater level measurements from NWISweb.} \usage{ -readNWISgwl(siteNumber, startDate, endDate) +readNWISgwl(siteNumber, startDate = "", endDate = "") } \arguments{ \item{siteNumber}{string USGS site number. This is usually an 8 digit number} diff --git a/man/readNWISmeas.Rd b/man/readNWISmeas.Rd index efac8331..01e9d9d1 100644 --- a/man/readNWISmeas.Rd +++ b/man/readNWISmeas.Rd @@ -3,7 +3,7 @@ \alias{readNWISmeas} \title{Reads surface-water measurement data from NWISweb.} \usage{ -readNWISmeas(siteNumber, startDate, endDate) +readNWISmeas(siteNumber, startDate = "", endDate = "", tz = "") } \arguments{ \item{siteNumber}{string USGS site number. This is usually an 8 digit number} @@ -11,12 +11,17 @@ readNWISmeas(siteNumber, startDate, endDate) \item{startDate}{string starting date for data retrieval in the form YYYY-MM-DD.} \item{endDate}{string ending date for data retrieval in the form YYYY-MM-DD.} + +\item{tz}{string to set timezone attribute of datetime. Default is an empty quote, which converts the +datetimes 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","America/Honolulu","America/Jamaica","America/Managua","America/Phoenix", and "America/Metlakatla"} } \description{ Reads surface-water measurement data from NWISweb. } \examples{ siteNumber <- '01594440' -data <- readNWISmeas(siteNumber, '','') +data <- readNWISmeas(siteNumber) } diff --git a/man/readNWISpeak.Rd b/man/readNWISpeak.Rd index 45c0eceb..df59298c 100644 --- a/man/readNWISpeak.Rd +++ b/man/readNWISpeak.Rd @@ -3,7 +3,7 @@ \alias{readNWISpeak} \title{Reads peak flow data from NWISweb.} \usage{ -readNWISpeak(siteNumber, startDate, endDate) +readNWISpeak(siteNumber, startDate = "", endDate = "") } \arguments{ \item{siteNumber}{string USGS site number. This is usually an 8 digit number} @@ -17,6 +17,6 @@ Reads peak flow data from NWISweb. } \examples{ siteNumber <- '01594440' -data <- readNWISpeak(siteNumber, '','') +data <- readNWISpeak(siteNumber) } diff --git a/man/readNWISrating.Rd b/man/readNWISrating.Rd index b93d20bf..88200fb6 100644 --- a/man/readNWISrating.Rd +++ b/man/readNWISrating.Rd @@ -3,7 +3,7 @@ \alias{readNWISrating} \title{Reads the current rating table for an active USGS streamgage.} \usage{ -readNWISrating(siteNumber, type) +readNWISrating(siteNumber, type = "base") } \arguments{ \item{siteNumber}{string USGS site number. This is usually an 8 digit number} diff --git a/man/readNWISunit.Rd b/man/readNWISuv.Rd similarity index 64% rename from man/readNWISunit.Rd rename to man/readNWISuv.Rd index ccd54228..9dbc2bef 100644 --- a/man/readNWISunit.Rd +++ b/man/readNWISuv.Rd @@ -1,9 +1,9 @@ % Generated by roxygen2 (4.0.2): do not edit by hand -\name{readNWISunit} -\alias{readNWISunit} +\name{readNWISuv} +\alias{readNWISuv} \title{Raw Data Import for Instantaneous USGS NWIS Data} \usage{ -readNWISunit(siteNumber, parameterCd, startDate, endDate) +readNWISuv(siteNumber, parameterCd, startDate = "", endDate = "", tz = "") } \arguments{ \item{siteNumber}{string USGS site number. This is usually an 8 digit number} @@ -13,6 +13,11 @@ readNWISunit(siteNumber, parameterCd, startDate, endDate) \item{startDate}{string starting date for data retrieval in the form YYYY-MM-DD.} \item{endDate}{string ending date for data retrieval in the form YYYY-MM-DD.} + +\item{tz}{string to set timezone attribute of datetime. Default is an empty quote, which converts the +datetimes 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","America/Honolulu","America/Jamaica","America/Managua","America/Phoenix", and "America/Metlakatla"} } \value{ data dataframe with agency, site, dateTime, time zone, value, and code columns @@ -28,9 +33,9 @@ parameterCd <- '00060' startDate <- "2014-10-10" endDate <- "2014-10-10" # These examples require an internet connection to run -rawData <- readNWISunit(siteNumber,parameterCd,startDate,endDate) +rawData <- readNWISuv(siteNumber,parameterCd,startDate,endDate) -timeZoneChange <- readNWISunit(c('04024430','04024000'),parameterCd, +timeZoneChange <- readNWISuv(c('04024430','04024000'),parameterCd, "2013-11-03","2013-11-03") firstSite <- timeZoneChange[timeZoneChange$site_no == '04024430',] } -- GitLab