From 0b418f94c26fc254ecb6884f29532846e97d578d Mon Sep 17 00:00:00 2001 From: unknown <ldecicco@usgs.gov> Date: Wed, 22 Oct 2014 08:51:49 -0500 Subject: [PATCH] Latest help file updates. --- man/constructNWISURL.Rd | 7 +------ man/constructWQPURL.Rd | 39 ++++++++++++++++++++++++++++++++++++ man/dataRetrieval-package.Rd | 4 ++-- man/getNWISPcodeInfo.Rd | 4 +--- man/getNWISdvData.Rd | 4 +--- man/getNWISqwData.Rd | 12 +---------- man/getNWISunitData.Rd | 5 +---- man/getWQPqwData.Rd | 6 ++---- man/getWaterML1Data.Rd | 2 +- man/getWaterML2Data.Rd | 26 ++++++++++++++++++++++++ man/parseWQPData.Rd | 30 +++++++++++++++++++++++++++ 11 files changed, 105 insertions(+), 34 deletions(-) create mode 100644 man/constructWQPURL.Rd create mode 100644 man/getWaterML2Data.Rd create mode 100644 man/parseWQPData.Rd diff --git a/man/constructNWISURL.Rd b/man/constructNWISURL.Rd index 384b286a..76a9d861 100644 --- a/man/constructNWISURL.Rd +++ b/man/constructNWISURL.Rd @@ -4,8 +4,7 @@ \title{Construct NWIS url for data retrieval} \usage{ constructNWISURL(siteNumber, parameterCd, startDate, endDate, service, - statCd = "00003", format = "xml", expanded = FALSE, - interactive = TRUE) + statCd = "00003", format = "xml", expanded = FALSE) } \arguments{ \item{siteNumber}{string or vector of strings USGS site number. This is usually an 8 digit number} @@ -25,8 +24,6 @@ but will offer a warning if the file was incomplete (for example, if there was a but the user must carefully check the results to see if the data returns matches what is expected. The default is therefore "xml".} \item{expanded}{logical defaults to FALSE. If TRUE, retrieves additional information, only applicable for qw data.} - -\item{interactive}{logical Option for interactive mode. If TRUE, there is user interaction for error handling and data checks.} } \value{ url string @@ -48,8 +45,6 @@ url_unit <- constructNWISURL(siteNumber,pCode,"2012-06-28","2012-06-30",'iv') url_qw_single <- constructNWISURL(siteNumber,"01075",startDate,endDate,'qw') url_qw <- constructNWISURL(siteNumber,c('01075','00029','00453'), startDate,endDate,'qw') -url_wqp <- constructNWISURL(paste("USGS",siteNumber,sep="-"),c('01075','00029','00453'), - startDate,endDate,'wqp') url_daily_tsv <- constructNWISURL(siteNumber,pCode,startDate,endDate,'dv', statCd=c("00003","00001"),format="tsv") } diff --git a/man/constructWQPURL.Rd b/man/constructWQPURL.Rd new file mode 100644 index 00000000..235ae776 --- /dev/null +++ b/man/constructWQPURL.Rd @@ -0,0 +1,39 @@ +% Generated by roxygen2 (4.0.2): do not edit by hand +\name{constructWQPURL} +\alias{constructWQPURL} +\title{Construct WQP url for data retrieval} +\usage{ +constructWQPURL(siteNumber, parameterCd, startDate, endDate) +} +\arguments{ +\item{siteNumber}{string or vector of strings USGS site number. This is usually an 8 digit number} + +\item{parameterCd}{string or vector of USGS parameter code. This is usually an 5 digit number.} + +\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.} +} +\value{ +url string +} +\description{ +Imports data from WQP web service. This function gets the data from here: \url{http://nwis.waterdata.usgs.gov/nwis/qwdata} +A list of parameter codes can be found here: \url{http://nwis.waterdata.usgs.gov/nwis/pmcodes/} +A list of statistic codes can be found here: \url{http://nwis.waterdata.usgs.gov/nwis/help/?read_file=stat&format=table} +} +\examples{ +siteNumber <- '01594440' +startDate <- '1985-01-01' +endDate <- '' +pCode <- c("00060","00010") +url_wqp <- constructWQPURL(paste("USGS",siteNumber,sep="-"), + c('01075','00029','00453'), + startDate,endDate) +} +\keyword{WQP} +\keyword{data} +\keyword{import} +\keyword{service} +\keyword{web} + diff --git a/man/dataRetrieval-package.Rd b/man/dataRetrieval-package.Rd index 06e4b149..58cb8dc8 100644 --- a/man/dataRetrieval-package.Rd +++ b/man/dataRetrieval-package.Rd @@ -7,8 +7,8 @@ \tabular{ll}{ Package: \tab dataRetrieval\cr Type: \tab Package\cr -Version: \tab 1.4.0\cr -Date: \tab 2014-09-16\cr +Version: \tab 1.5.0\cr +Date: \tab 2014-11-16\cr License: \tab Unlimited for this package, dependencies have more restrictive licensing.\cr Copyright: \tab This software is in the public domain because it contains materials that originally came from the United States Geological Survey, an agency of diff --git a/man/getNWISPcodeInfo.Rd b/man/getNWISPcodeInfo.Rd index 9dd734f8..c8fc769d 100644 --- a/man/getNWISPcodeInfo.Rd +++ b/man/getNWISPcodeInfo.Rd @@ -3,12 +3,10 @@ \alias{getNWISPcodeInfo} \title{USGS Parameter Data Retrieval} \usage{ -getNWISPcodeInfo(parameterCd, interactive = TRUE) +getNWISPcodeInfo(parameterCd) } \arguments{ \item{parameterCd}{vector of USGS parameter codes. This is usually an 5 digit number.} - -\item{interactive}{logical Option for interactive mode. If true, there is user interaction for error handling and data checks.} } \value{ parameterData dataframe with all information from the USGS about the particular parameter (usually code, name, short name, units, and CAS registry numbers) diff --git a/man/getNWISdvData.Rd b/man/getNWISdvData.Rd index 0568a571..93a9287c 100644 --- a/man/getNWISdvData.Rd +++ b/man/getNWISdvData.Rd @@ -4,7 +4,7 @@ \title{Raw Data Import for USGS NWIS Data} \usage{ getNWISdvData(siteNumber, parameterCd, startDate, endDate, statCd = "00003", - format = "tsv", interactive = TRUE) + format = "tsv") } \arguments{ \item{siteNumber}{string USGS site number. This is usually an 8 digit number. Multiple sites can be requested with a string vector.} @@ -20,8 +20,6 @@ getNWISdvData(siteNumber, parameterCd, startDate, endDate, statCd = "00003", \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'.} - -\item{interactive}{logical Option for interactive mode. If true, there is user interaction for error handling and data checks.} } \value{ data dataframe with agency, site, dateTime, value, and code columns diff --git a/man/getNWISqwData.Rd b/man/getNWISqwData.Rd index f172635b..c37a4abb 100644 --- a/man/getNWISqwData.Rd +++ b/man/getNWISqwData.Rd @@ -3,8 +3,7 @@ \alias{getNWISqwData} \title{Raw Data Import for USGS NWIS QW Data} \usage{ -getNWISqwData(siteNumber, pCodes, startDate, endDate, expanded = FALSE, - interactive = TRUE) +getNWISqwData(siteNumber, pCodes, startDate, endDate, expanded = FALSE) } \arguments{ \item{siteNumber}{string or vector of of USGS site numbers. This is usually an 8 digit number} @@ -18,8 +17,6 @@ getNWISqwData(siteNumber, pCodes, startDate, endDate, expanded = FALSE, \item{expanded}{logical defaults to FALSE. If TRUE, retrieves additional information. Expanded data includes remark_cd (remark code), result_va (result value), val_qual_tx (result value qualifier code), meth_cd (method code), dqi_cd (data-quality indicator code), rpt_lev_va (reporting level), and rpt_lev_cd (reporting level type).} - -\item{interactive}{logical Option for interactive mode. If true, there is user interaction for error handling and data checks.} } \value{ data dataframe with agency, site, dateTime, value, and code columns @@ -37,13 +34,6 @@ endDate <- '' pCodes <- c('34247','30234','32104','34220') rawNWISqwData <- getNWISqwData(siteNumber,pCodes,startDate,endDate) rawNWISqwDataExpand <- getNWISqwData(siteNumber,pCodes,startDate,endDate,expanded=TRUE) -# To get data in Sample dataframe format: -dataColumns <- grep("p\\\\d{5}",names(rawNWISqwData)) -remarkColumns <- grep("r\\\\d{5}",names(rawNWISqwData)) -totalColumns <-c(grep("sample_dt",names(rawNWISqwData)), dataColumns, remarkColumns) -totalColumns <- totalColumns[order(totalColumns)] -compressedData <- compressData(rawNWISqwData[,totalColumns]) -Sample <- populateSampleColumns(compressedData) } \seealso{ \code{\link{getWQPData}}, \code{\link{getWQPSites}}, diff --git a/man/getNWISunitData.Rd b/man/getNWISunitData.Rd index 0f23fbf2..773a5cef 100644 --- a/man/getNWISunitData.Rd +++ b/man/getNWISunitData.Rd @@ -3,8 +3,7 @@ \alias{getNWISunitData} \title{Raw Data Import for Instantaneous USGS NWIS Data} \usage{ -getNWISunitData(siteNumber, parameterCd, startDate, endDate, format = "xml", - interactive = TRUE) +getNWISunitData(siteNumber, parameterCd, startDate, endDate, format = "xml") } \arguments{ \item{siteNumber}{string USGS site number. This is usually an 8 digit number} @@ -18,8 +17,6 @@ getNWISunitData(siteNumber, parameterCd, startDate, endDate, format = "xml", \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 therefore "xml".} - -\item{interactive}{logical Option for interactive mode. If true, there is user interaction for error handling and data checks.} } \value{ data dataframe with agency, site, dateTime, time zone, value, and code columns diff --git a/man/getWQPqwData.Rd b/man/getWQPqwData.Rd index 4eb60fd4..af6da3c3 100644 --- a/man/getWQPqwData.Rd +++ b/man/getWQPqwData.Rd @@ -3,7 +3,7 @@ \alias{getWQPqwData} \title{Raw Data Import for Water Quality Portal} \usage{ -getWQPqwData(siteNumber, parameterCd, startDate, endDate, interactive = TRUE) +getWQPqwData(siteNumber, parameterCd, startDate, endDate) } \arguments{ \item{siteNumber}{string site number. This needs to include the full agency code prefix.} @@ -14,8 +14,6 @@ Leaving this blank will return all of the measured values during the specified t \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{interactive}{logical Option for interactive mode. If true, there is user interaction for error handling and data checks.} } \value{ retval dataframe raw data returned from the Water Quality Portal. Additionally, a POSIXct dateTime column is supplied for @@ -38,7 +36,7 @@ rawCharacteristicName <- getWQPqwData('WIDNR_WQX-10032762','Specific conductance } \seealso{ \code{\link{getWQPData}}, \code{\link{getWQPSites}}, -\code{\link{getNWISqwData}}, and \code{\link{readWQPData}} +\code{\link{getNWISqwData}}, and \code{\link{parseWQPData}} } \keyword{USGS} \keyword{data} diff --git a/man/getWaterML1Data.Rd b/man/getWaterML1Data.Rd index 70062731..58179dbb 100644 --- a/man/getWaterML1Data.Rd +++ b/man/getWaterML1Data.Rd @@ -31,7 +31,7 @@ groundWaterSite <- "431049071324301" startGW <- "2013-10-01" endGW <- "2014-06-30" groundwaterExampleURL <- constructNWISURL(groundWaterSite, NA, - startGW,endGW, service="gwlevels", format="xml",interactive=FALSE) + startGW,endGW, service="gwlevels", format="xml") groundWater <- getWaterML1Data(groundwaterExampleURL) unitDataURL <- constructNWISURL(siteNumber,property, "2014-10-10","2014-10-10",'uv',format='xml') diff --git a/man/getWaterML2Data.Rd b/man/getWaterML2Data.Rd new file mode 100644 index 00000000..7024add4 --- /dev/null +++ b/man/getWaterML2Data.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2 (4.0.2): do not edit by hand +\name{getWaterML2Data} +\alias{getWaterML2Data} +\title{Function to return data from the WaterML2 data} +\usage{ +getWaterML2Data(obs_url) +} +\arguments{ +\item{obs_url}{string containing the url for the retrieval} +} +\value{ +mergedDF a data frame containing columns agency, site, dateTime, values, and remark codes for all requested combinations +} +\description{ +This function accepts a url parameter for a WaterML2 getObservation +} +\examples{ +baseURL <- "http://waterservices.usgs.gov/nwis/dv/?format=waterml,2.0" +URL <- paste(baseURL, "sites=01646500", + "startDT=2014-09-01", + "endDT=2014-09-08", + "statCd=00003", + "parameterCd=00060",sep="&") +\dontrun{dataReturned3 <- getWaterML2Data(URL)} +} + diff --git a/man/parseWQPData.Rd b/man/parseWQPData.Rd new file mode 100644 index 00000000..52cca7ad --- /dev/null +++ b/man/parseWQPData.Rd @@ -0,0 +1,30 @@ +% Generated by roxygen2 (4.0.2): do not edit by hand +\name{parseWQPData} +\alias{parseWQPData} +\title{Basic Water Quality Portal Data grabber} +\usage{ +parseWQPData(url) +} +\arguments{ +\item{url}{string URL to Water Quality Portal#'} +} +\value{ +retval dataframe raw data returned from the Water Quality Portal. Additionally, a POSIXct dateTime column is supplied for +start and end times. +} +\description{ +Imports data from the Water Quality Portal based on a specified url. +} +\examples{ +# These examples require an internet connection to run + +## Examples take longer than 5 seconds: +rawSampleURL <- constructWQPURL('USGS-01594440','01075', '1985-01-01', '1985-03-31') +rawSample <- parseWQPData(rawSampleURL) +} +\keyword{USGS} +\keyword{data} +\keyword{import} +\keyword{service} +\keyword{web} + -- GitLab