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

Changed back to datetime for dailys.

parent cb4117c9
No related branches found
No related tags found
1 merge request!88Took out calls to NWIS in vignette.
......@@ -46,11 +46,13 @@
#' #Not empty:
#' multiSite <- readNWISdata(sites=c("04025500","040263491"), service="iv", parameterCd="00060")
#' bBoxEx <- readNWISdata(bBox=c(-83,36.5,-81,38.5), parameterCd="00010")
#'
#' startDate <- as.Date("2013-10-01")
#' endDate <- as.Date("2014-09-30")
#' waterYear <- readNWISdata(bBox=c(-83,36.5,-81,38.5), parameterCd="00010",
#' service="dv", startDate=startDate, endDate=endDate)
#' siteInfo <- readNWISdata(stateCd="WI", parameterCd="00010",hasDataTypeCd="iv", service="site")
#' siteInfo <- readNWISdata(stateCd="WI", parameterCd="00010",
#' hasDataTypeCd="iv", service="site")
#' }
readNWISdata <- function(service="dv", ...){
......@@ -94,9 +96,7 @@ readNWISdata <- function(service="dv", ...){
} else {
retval <- importWaterML1(urlCall, asDateTime = ("iv" == service))
if("dv" == service){
retval$dateTime <- as.Date(retval$dateTime)
retval$tz_cd <- NULL
names(retval)[names(retval) == "dateTime"] <- "Date"
retval$dateTime <- as.POSIXct(retval$dateTime)
}
}
......
......@@ -14,7 +14,7 @@ test_that("General NWIS retrievals working", {
endDate <- as.Date("2014-09-30")
waterYear <- readNWISdata(bBox=c(-83,36.5,-81,38.5), parameterCd="00010",
service="dv", startDate=startDate, endDate=endDate)
expect_is(waterYear$Date, 'Date')
expect_is(waterYear$dateTime, 'POSIXct')
siteInfo <- readNWISdata(stateCd="WI", parameterCd="00010",hasDataTypeCd="iv",
service="site")
......
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