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

Merge pull request #121 from ldecicco-USGS/master

Timezone with daylight savings.
parents 91e8b2c9 684a3570
No related branches found
No related tags found
No related merge requests found
vignettes\figure
^.*\.Rproj$
^\.Rproj\.user$
^\.Rproj\inst\dataRetrieval.log
......
Package: dataRetrieval
Type: Package
Title: Retrieval Functions for USGS and EPA Hydrologic and Water Quality Data
Version: 2.2.0
Date: 2015-04-07
Version: 2.2.1
Date: 2015-04-22
Authors@R: c( person("Robert", "Hirsch", role = c("aut"),
email = "rhirsch@usgs.gov"),
person("Laura", "DeCicco", role = c("aut","cre"),
......
# Generated by roxygen2 (4.1.0): do not edit by hand
# Generated by roxygen2 (4.1.1): do not edit by hand
export(checkWQPdates)
export(constructNWISURL)
......
......@@ -87,6 +87,10 @@
#' fullPath <- file.path(filePath, fileName)
#' imporFile <- importWaterML1(fullPath,TRUE)
#'
#'#Timezone change with specified local timezone:
#' tzURL <- constructNWISURL("04027000", c("00300","63680"), "2011-11-05", "2011-11-07","uv")
#' tzIssue <- importWaterML1(tzURL, TRUE, "America/Chicago")
#'
importWaterML1 <- function(obs_url,asDateTime=FALSE, tz=""){
if(file.exists(obs_url)){
......@@ -273,13 +277,13 @@ importWaterML1 <- function(obs_url,asDateTime=FALSE, tz=""){
}
}
if(tz != ""){
attr(datetime, "tzone") <- tz
df$tz_cd <- rep(tz, nrow(df))
} else {
attr(datetime, "tzone") <- "UTC"
df$tz_cd <- rep("UTC", nrow(df))
}
# if(tz != ""){
# attr(datetime, "tzone") <- tz
# df$tz_cd <- rep(tz, nrow(df))
# } else {
# attr(datetime, "tzone") <- "UTC"
# df$tz_cd <- rep("UTC", nrow(df))
# }
} else {
......@@ -308,9 +312,6 @@ importWaterML1 <- function(obs_url,asDateTime=FALSE, tz=""){
}
columnsOrderd <- columnsOrdered[columnsOrdered %in% names(df)]
df <- df[,columnsOrderd]
if (is.null(mergedDF)){
......@@ -456,6 +457,15 @@ importWaterML1 <- function(obs_url,asDateTime=FALSE, tz=""){
mergedDF <- data.frame()
}
if(asDateTime){
if(tz != ""){
attr(mergedDF$dateTime, "tzone") <- tz
mergedDF$tz_cd <- rep(tz, nrow(mergedDF))
} else {
attr(mergedDF$dateTime, "tzone") <- "UTC"
mergedDF$tz_cd <- rep("UTC", nrow(mergedDF))
}
}
variableInformation$noDataValue <- rep(NA, nrow(variableInformation))
row.names(mergedDF) <- NULL
......
% Generated by roxygen2 (4.1.0): do not edit by hand
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/checkWQPdates.r
\name{checkWQPdates}
\alias{checkWQPdates}
......
% Generated by roxygen2 (4.1.0): do not edit by hand
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/constructNWISURL.r
\name{constructNWISURL}
\alias{constructNWISURL}
......
% Generated by roxygen2 (4.1.0): do not edit by hand
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/constructNWISURL.r
\name{constructWQPURL}
\alias{constructWQPURL}
......
% Generated by roxygen2 (4.1.0): do not edit by hand
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/tabbedDataRetrievals.R
\docType{data}
\name{countyCd}
......
% Generated by roxygen2 (4.1.0): do not edit by hand
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/tabbedDataRetrievals.R
\docType{package}
\name{dataRetrieval-package}
......
% Generated by roxygen2 (4.1.0): do not edit by hand
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/getWebServiceData.R
\name{getWebServiceData}
\alias{getWebServiceData}
......
% Generated by roxygen2 (4.1.0): do not edit by hand
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/importRDB1.r
\name{importRDB1}
\alias{importRDB1}
......
% Generated by roxygen2 (4.1.0): do not edit by hand
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/importWQP.R
\name{importWQP}
\alias{importWQP}
......
% Generated by roxygen2 (4.1.0): do not edit by hand
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/importWaterML1.r
\name{importWaterML1}
\alias{importWaterML1}
......@@ -93,6 +93,10 @@ filePath <- system.file("extdata", package="dataRetrieval")
fileName <- "WaterML1Example.xml"
fullPath <- file.path(filePath, fileName)
imporFile <- importWaterML1(fullPath,TRUE)
#Timezone change with specified local timezone:
tzURL <- constructNWISURL("04027000", c("00300","63680"), "2011-11-05", "2011-11-07","uv")
tzIssue <- importWaterML1(tzURL, TRUE, "America/Chicago")
}
\seealso{
\code{\link{renameNWISColumns}}
......
% Generated by roxygen2 (4.1.0): do not edit by hand
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/importWaterML2.r
\name{importWaterML2}
\alias{importWaterML2}
......
% Generated by roxygen2 (4.1.0): do not edit by hand
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/tabbedDataRetrievals.R
\docType{data}
\name{pCodeToName}
......
% Generated by roxygen2 (4.1.0): do not edit by hand
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/tabbedDataRetrievals.R
\docType{data}
\name{parameterCdFile}
......
% Generated by roxygen2 (4.1.0): do not edit by hand
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/readNWISdata.r
\name{readNWISdata}
\alias{readNWISdata}
......
% Generated by roxygen2 (4.1.0): do not edit by hand
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/readNWISdv.r
\name{readNWISdv}
\alias{readNWISdv}
......
% Generated by roxygen2 (4.1.0): do not edit by hand
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/readNWISunit.r
\name{readNWISgwl}
\alias{readNWISgwl}
......
% Generated by roxygen2 (4.1.0): do not edit by hand
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/readNWISunit.r
\name{readNWISmeas}
\alias{readNWISmeas}
......
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