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

Renamed file for clarity.

parent bf62a461
No related branches found
No related tags found
1 merge request!39Overhaul of function names. Move some functionality to EGRET.
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#' @param 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, #' @param 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 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'. #' but the user must carefully check the results to see if the data returns matches what is expected. The default is 'tsv'.
#' @param interactive logical Option for interactive mode. If true, there is user interaction for error handling and data checks.
#' @return data dataframe with agency, site, dateTime, value, and code columns #' @return data dataframe with agency, site, dateTime, value, and code columns
#' @export #' @export
#' @keywords data import USGS web service #' @keywords data import USGS web service
...@@ -31,9 +30,9 @@ ...@@ -31,9 +30,9 @@
#' startDate, endDate, statCd=c('00001','00003')) #' startDate, endDate, statCd=c('00001','00003'))
#' rawDailyMultiSites<- getNWISdvData(c("01491000","01645000"),c('00010','00060'), #' rawDailyMultiSites<- getNWISdvData(c("01491000","01645000"),c('00010','00060'),
#' startDate, endDate, statCd=c('00001','00003')) #' startDate, endDate, statCd=c('00001','00003'))
getNWISdvData <- function (siteNumber,parameterCd,startDate,endDate,statCd="00003",format="tsv",interactive=TRUE){ getNWISdvData <- function (siteNumber,parameterCd,startDate,endDate,statCd="00003",format="tsv"){
url <- constructNWISURL(siteNumber,parameterCd,startDate,endDate,"dv",statCd=statCd,format=format,interactive=interactive) url <- constructNWISURL(siteNumber,parameterCd,startDate,endDate,"dv",statCd=statCd,format=format)
if (format == "xml") { if (format == "xml") {
data <- getWaterML1Data(url) data <- getWaterML1Data(url)
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#' @param expanded logical defaults to FALSE. If TRUE, retrieves additional information. Expanded data includes #' @param 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), #' 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). #' dqi_cd (data-quality indicator code), rpt_lev_va (reporting level), and rpt_lev_cd (reporting level type).
#' @param interactive logical Option for interactive mode. If true, there is user interaction for error handling and data checks.
#' @keywords data import USGS web service #' @keywords data import USGS web service
#' @return data dataframe with agency, site, dateTime, value, and code columns #' @return data dataframe with agency, site, dateTime, value, and code columns
#' @export #' @export
...@@ -26,16 +25,9 @@ ...@@ -26,16 +25,9 @@
#' pCodes <- c('34247','30234','32104','34220') #' pCodes <- c('34247','30234','32104','34220')
#' rawNWISqwData <- getNWISqwData(siteNumber,pCodes,startDate,endDate) #' rawNWISqwData <- getNWISqwData(siteNumber,pCodes,startDate,endDate)
#' rawNWISqwDataExpand <- getNWISqwData(siteNumber,pCodes,startDate,endDate,expanded=TRUE) #' rawNWISqwDataExpand <- getNWISqwData(siteNumber,pCodes,startDate,endDate,expanded=TRUE)
#' # To get data in Sample dataframe format: getNWISqwData <- function (siteNumber,pCodes,startDate,endDate,expanded=FALSE){
#' 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)
getNWISqwData <- function (siteNumber,pCodes,startDate,endDate,expanded=FALSE,interactive=TRUE){
url <- constructNWISURL(siteNumber,pCodes,startDate,endDate,"qw",expanded=expanded,interactive=interactive) url <- constructNWISURL(siteNumber,pCodes,startDate,endDate,"qw",expanded=expanded)
data <- getRDB1Data(url,asDateTime=TRUE, qw=TRUE) data <- getRDB1Data(url,asDateTime=TRUE, qw=TRUE)
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#' @param parameterCd string USGS parameter code. This is usually an 5 digit number. #' @param parameterCd string USGS parameter code. This is usually an 5 digit number.
#' @param startDate string starting date for data retrieval in the form YYYY-MM-DD. #' @param startDate string starting date for data retrieval in the form YYYY-MM-DD.
#' @param endDate string ending date for data retrieval in the form YYYY-MM-DD. #' @param endDate string ending date for data retrieval in the form YYYY-MM-DD.
#' @param interactive logical Option for interactive mode. If true, there is user interaction for error handling and data checks.
#' @param 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, #' @param 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 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". #' but the user must carefully check the results to see if the data returns matches what is expected. The default is therefore "xml".
...@@ -25,9 +24,9 @@ ...@@ -25,9 +24,9 @@
#' summary(rawData) #' summary(rawData)
#' rawData2 <- getNWISunitData(siteNumber,parameterCd,startDate,endDate,"tsv") #' rawData2 <- getNWISunitData(siteNumber,parameterCd,startDate,endDate,"tsv")
#' summary(rawData2) #' summary(rawData2)
getNWISunitData <- function (siteNumber,parameterCd,startDate,endDate,format="xml",interactive=TRUE){ getNWISunitData <- function (siteNumber,parameterCd,startDate,endDate,format="xml"){
url <- constructNWISURL(siteNumber,parameterCd,startDate,endDate,"uv",format=format,interactive=interactive) url <- constructNWISURL(siteNumber,parameterCd,startDate,endDate,"uv",format=format)
if (format == "xml") { if (format == "xml") {
data <- getWaterML1Data(url) data <- getWaterML1Data(url)
} else { } else {
......
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