Skip to content
Snippets Groups Projects
Commit 63bd1ac4 authored by Laura A DeCicco's avatar Laura A DeCicco
Browse files

Added some help. Deprecated old getWQPData (this was the only place it was used).

parent 01f9a485
No related branches found
No related tags found
1 merge request!15Fixed some bugs, changed getGeneralWQPData to getWQPData
#' Import Sample Data for WRTDS
#'
#' Imports data from the Water Quality Portal. This function gets the data from: \url{http://www.waterqualitydata.us}
#' Imports data from the Water Quality Portal, so it could be STORET, NWIS, or . This function gets the data from: \url{http://www.waterqualitydata.us}
#' For raw data, use getWQPData. This function will retrieve the raw data, and compress it (summing constituents). See
#' chapter 7 of the EGRET user guide for more details, then converts it to the Sample dataframe structure.
#'
......@@ -12,13 +12,33 @@
#' @keywords data import USGS WRTDS
#' @export
#' @return Sample dataframe
#' @seealso \code{\link{compressData}}, \code{\link{populateSampleColumns}}
#' @seealso \code{\link{getWQPData}}, \code{\link{getWQPSites}},
#' \code{\link{retrieveWQPqwData}}, \code{\link{retrieveNWISqwData}}, and \code{\link{basicWQPData}},
#' \code{\link{compressData}}, \code{\link{populateSampleColumns}}
#' @examples
#' # These examples require an internet connection to run
#' Sample_01075 <- getSTORETSampleData('USGS-01594440','Chloride', '', '')
#' Sample_All <- getSTORETSampleData('WIDNR_WQX-10032762','Specific conductance', '', '')
getSTORETSampleData <- function(siteNumber,characteristicName,startDate,endDate,interactive=TRUE){
data <- getWQPData(siteNumber,characteristicName,startDate,endDate,interactive=interactive)
retval <- retrieveWQPqwData(siteNumber=siteNumber,
parameterCd=characteristicName,
startDate=startDate,
endDate=endDate,
interactive=interactive)
#Check for pcode:
if(all(nchar(characteristicName) == 5)){
suppressWarnings(pCodeLogic <- all(!is.na(as.numeric(characteristicName))))
} else {
pCodeLogic <- FALSE
}
if(nrow(retval) > 0){
data <- processQWData(retval,pCodeLogic)
} else {
data <- NULL
}
compressedData <- compressData(data, interactive=interactive)
Sample <- populateSampleColumns(compressedData)
return(Sample)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment