diff --git a/R/whatNWISData.r b/R/whatNWISData.r index 16d577eb47996c52ee2db9b1f04fcac9cdd3daea..0b69eb47d405af60b739c28c22a20581df3711a0 100644 --- a/R/whatNWISData.r +++ b/R/whatNWISData.r @@ -3,7 +3,7 @@ #' Imports a table of available parameters, period of record, and count. #' #' @param siteNumber string USGS site number. -#' @param type vector string. Options are "uv", "dv", "qw" +#' @param service vector string. Options are "uv", "dv", "qw" #' @keywords data import USGS web service #' @return retval dataframe with all information found in the expanded site file #' @export @@ -11,9 +11,9 @@ #' @examples #' availableData <- whatNWISData('05114000') #' # To find just unit value ('instantaneous') data: -#' uvData <- whatNWISData('05114000',type="uv") -#' uvDataMulti <- whatNWISData(c('05114000','09423350'),type="uv") -whatNWISData <- function(siteNumber,type=c("uv","dv","qw")){ +#' uvData <- whatNWISData('05114000',service="uv") +#' uvDataMulti <- whatNWISData(c('05114000','09423350'),service="uv") +whatNWISData <- function(siteNumber,service=c("uv","dv","qw")){ siteNumber <- paste(siteNumber,collapse=",") @@ -45,7 +45,11 @@ whatNWISData <- function(siteNumber,type=c("uv","dv","qw")){ SiteFile <- SiteFile[-1,] - SiteFile <- with(SiteFile, data.frame(site_no=site_no, parameter_cd=parm_cd, statCd=stat_cd, startDate=begin_date,endDate=end_date, count=count_nu,service=data_type_cd,stringsAsFactors = FALSE)) + SiteFile <- with(SiteFile, data.frame(site_no=site_no, + parameter_cd=parm_cd, statCd=stat_cd, + startDate=begin_date,endDate=end_date, + count=count_nu,service=data_type_cd, + stringsAsFactors = FALSE)) SiteFile <- SiteFile[!is.na(SiteFile$parameter_cd),] SiteFile <- SiteFile["" != SiteFile$parameter_cd,] @@ -59,7 +63,7 @@ whatNWISData <- function(siteNumber,type=c("uv","dv","qw")){ pcodeINFO <- parameterCdFile[parameterCdFile$parameter_cd %in% pCodes,] SiteFile <- merge(SiteFile,pcodeINFO,by="parameter_cd") - SiteFile <- SiteFile[SiteFile$service %in% type,] + SiteFile <- SiteFile[SiteFile$service %in% service,] return(SiteFile) } else { message(paste("URL caused an error:", urlSitefile)) diff --git a/README.md b/README.md index a8519ab4b324e9f27212f8a421959b73e53494e0..af5ca46b24ef037003fc7eda27208088ceb1417d 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,14 @@ Web service retrieval functions: |Function | Inputs | Description | | -------------| -------------|:-------------| |`readNWISdata` | `...`, service | NWIS data using user-specified queries | -|`readNWISdv` | `Common 4`, statCd | NWIS data with `Common 4` query | +|`readNWISdv` | `Common 4`, statCd | NWIS daily data with `Common 4` query | +|`readNWISqw` | `Common 4`, expanded | NWIS water quality data with `Common 4` query | +|`readNWISunit` | `Common 4`, statCd | NWIS instantaneous data with `Common 4` query | +|`readNWISpCode` | parameterCd | NWIS parameter code information | +|`readNWISsite` | siteNumber | NWIS site information | +|`whatNWISsites` | `...` | NWIS sites using user-specified queries | +|`whatNWISdata` | siteNumber, service | NWIS data availability, including period of record and count | + * `Common 4` = siteNumber, parameterCd, startDate, endDate diff --git a/man/whatNWISData.Rd b/man/whatNWISData.Rd index 374a2728e01615ec496a23127e34699b46c51a45..e159dd5b45e07a499ac5f5c3cf4663badcef62c2 100644 --- a/man/whatNWISData.Rd +++ b/man/whatNWISData.Rd @@ -3,12 +3,12 @@ \alias{whatNWISData} \title{USGS data availability} \usage{ -whatNWISData(siteNumber, type = c("uv", "dv", "qw")) +whatNWISData(siteNumber, service = c("uv", "dv", "qw")) } \arguments{ \item{siteNumber}{string USGS site number.} -\item{type}{vector string. Options are "uv", "dv", "qw"} +\item{service}{vector string. Options are "uv", "dv", "qw"} } \value{ retval dataframe with all information found in the expanded site file @@ -19,8 +19,8 @@ Imports a table of available parameters, period of record, and count. \examples{ availableData <- whatNWISData('05114000') # To find just unit value ('instantaneous') data: -uvData <- whatNWISData('05114000',type="uv") -uvDataMulti <- whatNWISData(c('05114000','09423350'),type="uv") +uvData <- whatNWISData('05114000',service="uv") +uvDataMulti <- whatNWISData(c('05114000','09423350'),service="uv") } \keyword{USGS} \keyword{data}