From b696957022bc2e0cab6d38b209b5440d8266df4a Mon Sep 17 00:00:00 2001 From: unknown <ldecicco@usgs.gov> Date: Fri, 19 Sep 2014 16:54:15 -0500 Subject: [PATCH] Renamed getGeneralWQPData --- R/getGeneralWQPData.R | 36 ------------------------------------ man/getGeneralWQPData.Rd | 28 ---------------------------- 2 files changed, 64 deletions(-) delete mode 100644 R/getGeneralWQPData.R delete mode 100644 man/getGeneralWQPData.Rd diff --git a/R/getGeneralWQPData.R b/R/getGeneralWQPData.R deleted file mode 100644 index 4faf41f2..00000000 --- a/R/getGeneralWQPData.R +++ /dev/null @@ -1,36 +0,0 @@ -#' General Data Import from Water Quality Portal -#' -#' Imports data from Water Quality Portal web service. This function gets the data from here: \url{http://www.waterqualitydata.us}. -#' because it allows for other agencies rather than the USGS. -#' -#' @param \dots see \url{www.waterqualitydata.us/webservices_documentation.jsp} for a complete list of options -#' @keywords data import WQP web service -#' @return retval dataframe with first column dateTime, and at least one qualifier and value columns -#' (subsequent qualifier/value columns could follow depending on requested parameter codes) -#' @export -#' @examples -#' nameToUse <- "pH" -#' pHData <- getGeneralWQPData(siteid="USGS-04024315",characteristicName=nameToUse) -getGeneralWQPData <- function(...){ - - matchReturn <- match.call() - - options <- c("bBox","lat","long","within","countrycode","statecode","countycode","siteType","organization", - "siteid","huc","sampleMedia","characteristicType","characteristicName","pCode","activityId", - "startDateLo","startDateHi","mimeType","Zip","providers") - - if(!all(names(matchReturn[-1]) %in% options)) warning(matchReturn[!(names(matchReturn[-1]) %in% options)],"is not a valid query parameter to the Water Quality Portal") - - values <- sapply(matchReturn[-1], function(x) URLencode(as.character(paste(eval(x),collapse="",sep="")))) - - urlCall <- paste(paste(names(values),values,sep="="),collapse="&") - - - baseURL <- "http://www.waterqualitydata.us/Result/search?" - urlCall <- paste(baseURL, - urlCall, - "&mimeType=tsv",sep = "") - retVal <- basicWQPData(urlCall) - return(retVal) - -} \ No newline at end of file diff --git a/man/getGeneralWQPData.Rd b/man/getGeneralWQPData.Rd deleted file mode 100644 index 2823493d..00000000 --- a/man/getGeneralWQPData.Rd +++ /dev/null @@ -1,28 +0,0 @@ -% Generated by roxygen2 (4.0.2): do not edit by hand -\name{getGeneralWQPData} -\alias{getGeneralWQPData} -\title{General Data Import from Water Quality Portal} -\usage{ -getGeneralWQPData(...) -} -\arguments{ -\item{\dots}{see \url{www.waterqualitydata.us/webservices_documentation.jsp} for a complete list of options} -} -\value{ -retval dataframe with first column dateTime, and at least one qualifier and value columns -(subsequent qualifier/value columns could follow depending on requested parameter codes) -} -\description{ -Imports data from Water Quality Portal web service. This function gets the data from here: \url{http://www.waterqualitydata.us}. -because it allows for other agencies rather than the USGS. -} -\examples{ -nameToUse <- "pH" -pHData <- getGeneralWQPData(siteid="USGS-04024315",characteristicName=nameToUse) -} -\keyword{WQP} -\keyword{data} -\keyword{import} -\keyword{service} -\keyword{web} - -- GitLab