# NOT RUN {
site_id <- "02177000"
startDate <- "2012-09-01"
endDate <- "2012-10-01"
offering <- '00003'
property <- '00060'
obs_url <- constructNWISURL(site_id,property,startDate,endDate,'dv')
# }
# NOT RUN {
data <- importWaterML1(obs_url, asDateTime=TRUE)
groundWaterSite <- "431049071324301"
startGW <- "2013-10-01"
endGW <- "2014-06-30"
groundwaterExampleURL <- constructNWISURL(groundWaterSite, NA,
startGW,endGW, service="gwlevels")
groundWater <- importWaterML1(groundwaterExampleURL)
groundWater2 <- importWaterML1(groundwaterExampleURL, asDateTime=TRUE)
unitDataURL <- constructNWISURL(site_id,property,
"2013-11-03","2013-11-03",'uv')
unitData <- importWaterML1(unitDataURL,TRUE)
# Two sites, two pcodes, one site has two data descriptors:
siteNumber <- c('01480015',"04085427")
obs_url <- constructNWISURL(siteNumber,c("00060","00010"),startDate,endDate,'dv')
data <- importWaterML1(obs_url)
data$dateTime <- as.Date(data$dateTime)
data <- renameNWISColumns(data)
names(attributes(data))
attr(data, "url")
attr(data, "disclaimer")
inactiveSite <- "05212700"
inactiveSite <- constructNWISURL(inactiveSite, "00060", "2014-01-01", "2014-01-10",'dv')
inactiveSite <- importWaterML1(inactiveSite)
inactiveAndAcitive <- c("07334200","05212700")
inactiveAndAcitive <- constructNWISURL(inactiveAndAcitive, "00060", "2014-01-01", "2014-01-10",'dv')
inactiveAndAcitive <- importWaterML1(inactiveAndAcitive)
# Timezone change with specified local timezone:
tzURL <- constructNWISURL("04027000", c("00300","63680"), "2011-11-05", "2011-11-07","uv")
tzIssue <- importWaterML1(tzURL,
asDateTime = TRUE, tz = "America/Chicago")
# raw XML
url <- constructNWISURL(service = 'dv', siteNumber = '02319300', parameterCd = "00060",
startDate = "2014-01-01", endDate = "2014-01-01")
raw <- httr::content(httr::GET(url), as = 'raw')
rawParsed <- importWaterML1(raw)
# }
# NOT RUN {
filePath <- system.file("extdata", package="dataRetrieval")
fileName <- "WaterML1Example.xml"
fullPath <- file.path(filePath, fileName)
importFile <- importWaterML1(fullPath,TRUE)
# }
Run the code above in your browser using DataLab