Skip to content

Commit

Permalink
Merge pull request #121 from ldecicco-USGS/master
Browse files Browse the repository at this point in the history
Timezone with daylight savings.
  • Loading branch information
ldecicco-USGS committed Apr 22, 2015
2 parents 91e8b2c + 684a357 commit 2168322
Show file tree
Hide file tree
Showing 35 changed files with 59 additions and 44 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
vignettes\figure
^.*\.Rproj$
^\.Rproj\.user$
^\.Rproj\inst\dataRetrieval.log
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
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 = "[email protected]"),
person("Laura", "DeCicco", role = c("aut","cre"),
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 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)
Expand Down
30 changes: 20 additions & 10 deletions R/importWaterML1.r
Original file line number Diff line number Diff line change
Expand Up @@ -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)){
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -308,9 +312,6 @@ importWaterML1 <- function(obs_url,asDateTime=FALSE, tz=""){
}

columnsOrderd <- columnsOrdered[columnsOrdered %in% names(df)]



df <- df[,columnsOrderd]

if (is.null(mergedDF)){
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion man/checkWQPdates.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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}
Expand Down
2 changes: 1 addition & 1 deletion man/constructNWISURL.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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}
Expand Down
2 changes: 1 addition & 1 deletion man/constructWQPURL.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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}
Expand Down
2 changes: 1 addition & 1 deletion man/countyCd.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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}
Expand Down
2 changes: 1 addition & 1 deletion man/dataRetrieval-package.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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}
Expand Down
2 changes: 1 addition & 1 deletion man/getWebServiceData.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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}
Expand Down
2 changes: 1 addition & 1 deletion man/importRDB1.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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}
Expand Down
2 changes: 1 addition & 1 deletion man/importWQP.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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}
Expand Down
6 changes: 5 additions & 1 deletion man/importWaterML1.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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}
Expand Down Expand Up @@ -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}}
Expand Down
2 changes: 1 addition & 1 deletion man/importWaterML2.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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}
Expand Down
2 changes: 1 addition & 1 deletion man/pCodeToName.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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}
Expand Down
2 changes: 1 addition & 1 deletion man/parameterCdFile.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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}
Expand Down
2 changes: 1 addition & 1 deletion man/readNWISdata.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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}
Expand Down
2 changes: 1 addition & 1 deletion man/readNWISdv.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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}
Expand Down
2 changes: 1 addition & 1 deletion man/readNWISgwl.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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}
Expand Down
2 changes: 1 addition & 1 deletion man/readNWISmeas.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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}
Expand Down
2 changes: 1 addition & 1 deletion man/readNWISpCode.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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/readNWISpCode.r
\name{readNWISpCode}
\alias{readNWISpCode}
Expand Down
2 changes: 1 addition & 1 deletion man/readNWISpeak.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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{readNWISpeak}
\alias{readNWISpeak}
Expand Down
2 changes: 1 addition & 1 deletion man/readNWISqw.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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/readNWISqw.r
\name{readNWISqw}
\alias{readNWISqw}
Expand Down
2 changes: 1 addition & 1 deletion man/readNWISrating.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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{readNWISrating}
\alias{readNWISrating}
Expand Down
2 changes: 1 addition & 1 deletion man/readNWISsite.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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/readNWISsite.r
\name{readNWISsite}
\alias{readNWISsite}
Expand Down
2 changes: 1 addition & 1 deletion man/readNWISuv.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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{readNWISuv}
\alias{readNWISuv}
Expand Down
2 changes: 1 addition & 1 deletion man/readWQPdata.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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/readWQPdata.R
\name{readWQPdata}
\alias{readWQPdata}
Expand Down
2 changes: 1 addition & 1 deletion man/readWQPqw.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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/readWQPqw.r
\name{readWQPqw}
\alias{readWQPqw}
Expand Down
2 changes: 1 addition & 1 deletion man/renameNWISColumns.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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/renameColumns.R
\name{renameNWISColumns}
\alias{renameNWISColumns}
Expand Down
2 changes: 1 addition & 1 deletion man/stateCd.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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{stateCd}
Expand Down
2 changes: 1 addition & 1 deletion man/stateCdLookup.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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{stateCdLookup}
\alias{stateCdLookup}
Expand Down
2 changes: 1 addition & 1 deletion man/whatNWISData.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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/whatNWISdata.r
\name{whatNWISdata}
\alias{whatNWISdata}
Expand Down
2 changes: 1 addition & 1 deletion man/whatNWISsites.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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/whatNWISsites.R
\name{whatNWISsites}
\alias{whatNWISsites}
Expand Down
2 changes: 1 addition & 1 deletion man/whatWQPsites.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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/whatWQPsites.R
\name{whatWQPsites}
\alias{whatWQPsites}
Expand Down
2 changes: 1 addition & 1 deletion man/zeroPad.Rd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% 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/zeroPad.r
\name{zeroPad}
\alias{zeroPad}
Expand Down

0 comments on commit 2168322

Please sign in to comment.