diff --git a/DESCRIPTION b/DESCRIPTION index 4e0420af039f8703c9d304aee4827a99abe928da..dd3557b30c818d6bcf1c7c42edd5ac134a94b9fb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -35,8 +35,6 @@ Suggests: xtable, knitr, testthat -LazyLoad: yes -LazyData: yes VignetteBuilder: knitr BuildVignettes: true URL: https://github.com/USGS-R/dataRetrieval, http://pubs.usgs.gov/tm/04/a10/ diff --git a/R/constructNWISURL.r b/R/constructNWISURL.r index 11440d146aa2c8d12fc90e50d88538240a678bea..c484f598c488298cc0e83c7be490bcb7005f4264 100644 --- a/R/constructNWISURL.r +++ b/R/constructNWISURL.r @@ -48,8 +48,6 @@ constructNWISURL <- function(siteNumber,parameterCd="00060",startDate="",endDate service <- match.arg(service, c("dv","uv","iv","qw","gwlevels","rating","peak","meas")) - data("parameterCdFile") - if(any(!is.na(parameterCd))){ pcodeCheck <- all(nchar(parameterCd) == 5) & all(!is.na(suppressWarnings(as.numeric(parameterCd)))) diff --git a/R/readNWISpCode.r b/R/readNWISpCode.r index 01e4dee75e5b31f7c4779a8fca0c3cbeb21d4b33..f6afad5309a14c71ef0eddd2f346f83a61623162 100644 --- a/R/readNWISpCode.r +++ b/R/readNWISpCode.r @@ -24,8 +24,6 @@ readNWISpCode <- function(parameterCd){ pcodeCheck <- all(nchar(parameterCd) == 5) & all(!is.na(suppressWarnings(as.numeric(parameterCd)))) - data("parameterCdFile") - if(!pcodeCheck){ goodIndex <- which(parameterCd %in% parameterCdFile$parameter_cd) if(length(goodIndex) > 0){ diff --git a/R/sysdata.rda b/R/sysdata.rda new file mode 100644 index 0000000000000000000000000000000000000000..926db280a85d611277c8e141d38d2fee14711efa Binary files /dev/null and b/R/sysdata.rda differ diff --git a/R/tabbedDataRetrievals.R b/R/tabbedDataRetrievals.R index 4d4dacf41c0d095b27559587a70c4d68a1a0ee6d..52ec04260de20a5d97932eba351eecd208e04185 100644 --- a/R/tabbedDataRetrievals.R +++ b/R/tabbedDataRetrievals.R @@ -3,8 +3,8 @@ #' \tabular{ll}{ #' Package: \tab dataRetrieval\cr #' Type: \tab Package\cr -#' Version: \tab 2.0.1\cr -#' Date: \tab 2014-12-02\cr +#' Version: \tab 2.0.2\cr +#' Date: \tab 2014-12-15\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 @@ -24,59 +24,3 @@ #' @keywords USGS, web services NULL - -#' List of USGS parameter codes -#' -#' Complete list of USGS parameter codes as of November 7, 2014. The data was pulled from -#' \url{http://nwis.waterdata.usgs.gov/nwis/pmcodes/pmcodes?radio_pm_search=param_group&pm_group=All+--+include+all+parameter+groups& -#' format=rdb&show=parameter_group_nm&show=parameter_nm&show=casrn&show=srsname&show=parameter_units} -#' -#' @name parameterCdFile -#' @return parameterData data frame with information about USGS parameters. -#' -#' \tabular{lll}{ -#' Name \tab Type \tab Description\cr -#' parameter_cd \tab character \tab 5-digit USGS parameter code \cr -#' parameter_group_nm \tab character \tab USGS parameter group name\cr -#' parameter_nm \tab character \tab USGS parameter name\cr -#' casrn \tab character \tab Chemical Abstracts Service (CAS) Registry Number\cr -#' srsname \tab character \tab Substance Registry Services Name\cr -#' parameter_units \tab character \tab Parameter units\cr -#' } -#' -#' @docType data -#' @keywords USGS parameterCd -#' @examples -#' data(parameterCdFile) -#' dischargeInfo <- parameterCdFile[parameterCdFile$parameter_cd=="00060",] -NULL - -#' Data to convert USGS parameter code to characteristic names -#' -#' Data pulled from Water Quality Portal on November 25, 2014. The data was pulled from -#' \url{http://www.waterqualitydata.us/public_srsnames?mimeType=json}. -#' -#' @name pCodeToName -#' @return pCodeToName data frame with information about USGS parameters and how they -#' relate to characteristic names (useful for WQP requests). -#' -#' \tabular{lll}{ -#' Name \tab Type \tab Description\cr -#' parm_cd \tab character \tab 5-digit USGS parameter code \cr -#' description \tab character \tab Parameter description\cr -#' characteristicname \tab character \tab Characteristic Name \cr -#' measureunitcode \tab character \tab Parameter units\cr -#' resultsamplefraction \tab character \tab Result sample fraction text\cr -#' resulttemperaturebasis \tab character \tab Temperature basis information\cr -#' resultstatisticalbasis \tab character \tab Statistical basis\cr -#' resulttimebasis \tab character \tab Time basis\cr -#' resultweightbasis \tab character \tab Weight basis\cr -#' resultparticlesizebasis \tab character \tab Particle size basis\cr -#' last_rev_dt \tab character \tab Latest revision of information\cr -#' } -#' @docType data -#' @keywords USGS parameterCd -#' @examples -#' pCodeToName <- pCodeToName -#' dischargeInfo <- pCodeToName[pCodeToName$parm_cd=="00060",] -NULL diff --git a/R/whatNWISData.r b/R/whatNWISData.r index 4155156fdf4cbfcb67d3475ccbdf5002af8be392..fb387313de58f236eb86d6ee731a8dd355aec107 100644 --- a/R/whatNWISData.r +++ b/R/whatNWISData.r @@ -71,9 +71,6 @@ whatNWISdata <- function(siteNumbers,service="all",parameterCd="all",statCd="all if(!("all" %in% service)){ service <- match.arg(service, c("dv","uv","qw","ad","id","pk","sv","gw","aw","all","ad","iv","rt"), several.ok = TRUE) } - - - data("parameterCdFile", envir = ) if(!("all" %in% parameterCd)){ parameterCdCheck <- all(nchar(parameterCd) == 5) & all(!is.na(suppressWarnings(as.numeric(parameterCd)))) diff --git a/data/pCodeToName.RData b/data/pCodeToName.RData deleted file mode 100644 index 185cb9d94aeaedc7c2bc0d097c885c6e4ed4af59..0000000000000000000000000000000000000000 Binary files a/data/pCodeToName.RData and /dev/null differ diff --git a/data/parameterCdFile.RData b/data/parameterCdFile.RData deleted file mode 100644 index d1f0f73e566ed055f304bad8c67b87312c49eb26..0000000000000000000000000000000000000000 Binary files a/data/parameterCdFile.RData and /dev/null differ diff --git a/man/dataRetrieval-package.Rd b/man/dataRetrieval-package.Rd index 0c10d22571320e24d222f4805ece22660a1f82a3..29c1c75a1cec050c1511f3d5e1dc738b11c119ae 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 2.0.1\cr -Date: \tab 2014-12-02\cr +Version: \tab 2.0.2\cr +Date: \tab 2014-12-15\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/pCodeToName.Rd b/man/pCodeToName.Rd deleted file mode 100644 index 736284dac0add9d1846ac70b7c7fe87bd44d7ed3..0000000000000000000000000000000000000000 --- a/man/pCodeToName.Rd +++ /dev/null @@ -1,35 +0,0 @@ -% Generated by roxygen2 (4.0.2): do not edit by hand -\docType{data} -\name{pCodeToName} -\alias{pCodeToName} -\title{Data to convert USGS parameter code to characteristic names} -\value{ -pCodeToName data frame with information about USGS parameters and how they -relate to characteristic names (useful for WQP requests). - -\tabular{lll}{ - Name \tab Type \tab Description\cr - parm_cd \tab character \tab 5-digit USGS parameter code \cr - description \tab character \tab Parameter description\cr - characteristicname \tab character \tab Characteristic Name \cr - measureunitcode \tab character \tab Parameter units\cr - resultsamplefraction \tab character \tab Result sample fraction text\cr - resulttemperaturebasis \tab character \tab Temperature basis information\cr - resultstatisticalbasis \tab character \tab Statistical basis\cr - resulttimebasis \tab character \tab Time basis\cr - resultweightbasis \tab character \tab Weight basis\cr - resultparticlesizebasis \tab character \tab Particle size basis\cr - last_rev_dt \tab character \tab Latest revision of information\cr -} -} -\description{ -Data pulled from Water Quality Portal on November 25, 2014. The data was pulled from -\url{http://www.waterqualitydata.us/public_srsnames?mimeType=json}. -} -\examples{ -pCodeToName <- pCodeToName -dischargeInfo <- pCodeToName[pCodeToName$parm_cd=="00060",] -} -\keyword{USGS} -\keyword{parameterCd} - diff --git a/man/parameterCdFile.Rd b/man/parameterCdFile.Rd deleted file mode 100644 index e52989d47c4a14499c7e787c72ae45aaf0347fac..0000000000000000000000000000000000000000 --- a/man/parameterCdFile.Rd +++ /dev/null @@ -1,30 +0,0 @@ -% Generated by roxygen2 (4.0.2): do not edit by hand -\docType{data} -\name{parameterCdFile} -\alias{parameterCdFile} -\title{List of USGS parameter codes} -\value{ -parameterData data frame with information about USGS parameters. - -\tabular{lll}{ - Name \tab Type \tab Description\cr - parameter_cd \tab character \tab 5-digit USGS parameter code \cr - parameter_group_nm \tab character \tab USGS parameter group name\cr - parameter_nm \tab character \tab USGS parameter name\cr - casrn \tab character \tab Chemical Abstracts Service (CAS) Registry Number\cr - srsname \tab character \tab Substance Registry Services Name\cr - parameter_units \tab character \tab Parameter units\cr -} -} -\description{ -Complete list of USGS parameter codes as of November 7, 2014. The data was pulled from -\url{http://nwis.waterdata.usgs.gov/nwis/pmcodes/pmcodes?radio_pm_search=param_group&pm_group=All+--+include+all+parameter+groups& -format=rdb&show=parameter_group_nm&show=parameter_nm&show=casrn&show=srsname&show=parameter_units} -} -\examples{ -data(parameterCdFile) -dischargeInfo <- parameterCdFile[parameterCdFile$parameter_cd=="00060",] -} -\keyword{USGS} -\keyword{parameterCd} - diff --git a/vignettes/dataRetrieval.Rnw b/vignettes/dataRetrieval.Rnw index 0cc9a4f7a8e47cd1222f47e02db7370f078736d1..10576b855b391689c6ec7a9ecdbca744f9b1b9d4 100644 --- a/vignettes/dataRetrieval.Rnw +++ b/vignettes/dataRetrieval.Rnw @@ -160,6 +160,7 @@ bold.colHeaders <- function(x) { returnX <- paste("\\multicolumn{1}{c}{\\textbf{\\textsf{", x, "}}}", sep = "") } addSpace <- function(x) ifelse(x != "1", "[5pt]","") +library(dataRetrieval) @ \noindent{\huge\textsf{\textbf{The dataRetrieval R package}}} @@ -306,13 +307,13 @@ print(xtable(data.df, @ -A complete list (as of November 7, 2014) is available as data attached to the package. It is accessed by the following: - -<<tableParameterCodesDataRetrieval, echo=TRUE, eval=TRUE>>= -library(dataRetrieval) -parameterCdFile <- parameterCdFile -names(parameterCdFile) -@ +% A complete list (as of November 7, 2014) is available as data attached to the package. It is accessed by the following: +% +% <<tableParameterCodesDataRetrieval, echo=TRUE, eval=TRUE>>= +% library(dataRetrieval) +% parameterCdFile <- parameterCdFile +% names(parameterCdFile) +% @ Two output columns that may not be obvious are \enquote{srsname} and \enquote{casrn}. Srsname stands for \enquote{Substance Registry Services}. More information on the srs name can be found here: