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

Made example lines shorter.

parent bb186aa3
No related branches found
No related tags found
1 merge request!9Added a lot of error handling.
...@@ -19,7 +19,9 @@ ...@@ -19,7 +19,9 @@
#' value2 <- c(2,3,4) #' value2 <- c(2,3,4)
#' comment3 <- c("","","<") #' comment3 <- c("","","<")
#' value3 <- c(3,4,5) #' value3 <- c(3,4,5)
#' dataInput <- data.frame(dateTime, comment1, value1, comment2, value2, comment3, value3, stringsAsFactors=FALSE) #' dataInput <- data.frame(dateTime, comment1, value1,
#' comment2, value2,
#' comment3, value3, stringsAsFactors=FALSE)
#' compressData(dataInput) #' compressData(dataInput)
compressData <- function(data, interactive=TRUE){ compressData <- function(data, interactive=TRUE){
......
...@@ -23,12 +23,16 @@ ...@@ -23,12 +23,16 @@
#' startDate <- '1985-01-01' #' startDate <- '1985-01-01'
#' endDate <- '' #' endDate <- ''
#' pCode <- c("00060","00010") #' pCode <- c("00060","00010")
#' url_daily <- constructNWISURL(siteNumber,pCode,startDate,endDate,'dv',statCd=c("00003","00001")) #' url_daily <- constructNWISURL(siteNumber,pCode,
#' startDate,endDate,'dv',statCd=c("00003","00001"))
#' url_unit <- constructNWISURL(siteNumber,pCode,"2012-06-28","2012-06-30",'iv') #' url_unit <- constructNWISURL(siteNumber,pCode,"2012-06-28","2012-06-30",'iv')
#' url_qw_single <- constructNWISURL(siteNumber,"01075",startDate,endDate,'qw') #' url_qw_single <- constructNWISURL(siteNumber,"01075",startDate,endDate,'qw')
#' url_qw <- constructNWISURL(siteNumber,c('01075','00029','00453'),startDate,endDate,'qw') #' url_qw <- constructNWISURL(siteNumber,c('01075','00029','00453'),
#' url_wqp <- constructNWISURL(paste("USGS",siteNumber,sep="-"),c('01075','00029','00453'),startDate,endDate,'wqp') #' startDate,endDate,'qw')
#' url_daily_tsv <- constructNWISURL(siteNumber,pCode,startDate,endDate,'dv',statCd=c("00003","00001"),format="tsv") #' url_wqp <- constructNWISURL(paste("USGS",siteNumber,sep="-"),c('01075','00029','00453'),
#' startDate,endDate,'wqp')
#' url_daily_tsv <- constructNWISURL(siteNumber,pCode,startDate,endDate,'dv',
#' statCd=c("00003","00001"),format="tsv")
constructNWISURL <- function(siteNumber,parameterCd,startDate,endDate,service,statCd="00003", format="xml",expanded=FALSE,interactive=TRUE){ constructNWISURL <- function(siteNumber,parameterCd,startDate,endDate,service,statCd="00003", format="xml",expanded=FALSE,interactive=TRUE){
startDate <- formatCheckDate(startDate, "StartDate", interactive=interactive) startDate <- formatCheckDate(startDate, "StartDate", interactive=interactive)
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
#' @examples #' @examples
#' site<- '01234567' #' site<- '01234567'
#' formatCheckSiteNumber(site) #' formatCheckSiteNumber(site)
#' site_incorrect <- '1234567'
#' formatCheckSiteNumber(site_incorrect)
formatCheckSiteNumber <- function(siteNumber, interactive=TRUE){ #checks for a 8 digit number formatCheckSiteNumber <- function(siteNumber, interactive=TRUE){ #checks for a 8 digit number
if (nchar(siteNumber) < 8){ if (nchar(siteNumber) < 8){
if (interactive){ if (interactive){
......
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
#' @examples #' @examples
#' # This example requires an internet connection to run #' # This example requires an internet connection to run
#' siteNumber <- '05114000' #' siteNumber <- '05114000'
#' rawData <- retrieveNWISdvData(siteNumber,c("00010","00060","00300"),"2001-01-01","2002-01-01",statCd=c("00001","00003")) #' rawData <- retrieveNWISdvData(siteNumber,c("00010","00060","00300"),
#' "2001-01-01","2002-01-01",statCd=c("00001","00003"))
#' rawData <- renameColumns(rawData) #' rawData <- renameColumns(rawData)
#' today <- as.character(Sys.Date()) #' today <- as.character(Sys.Date())
#' rawData2 <- retrieveNWISunitData(siteNumber,c("00010","00060"),today,today) #' rawData2 <- retrieveNWISunitData(siteNumber,c("00010","00060"),today,today)
......
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