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

Added timezone option.

parent 76c58a91
No related branches found
No related tags found
1 merge request!39Overhaul of function names. Move some functionality to EGRET.
......@@ -4,6 +4,10 @@
#'
#' @param url string URL to Water Quality Portal#' @keywords data import USGS web service
#' @param zip logical used to request the data in a zip format (TRUE)
#' @param tz string to set timezone attribute of datetime. Default is an empty quote, which converts the
#' datetimes to UTC (properly accounting for daylight savings times based on the data's provided tz_cd column).
#' Possible values to provide are "America/New_York","America/Chicago", "America/Denver","America/Los_Angeles",
#' "America/Anchorage","America/Honolulu","America/Jamaica","America/Managua","America/Phoenix", and "America/Metlakatla"
#' @return retval dataframe raw data returned from the Water Quality Portal. Additionally, a POSIXct dateTime column is supplied for
#' start and end times.
#' @export
......@@ -19,7 +23,7 @@
#' url2 <- paste0(rawSampleURL,"&zip=yes")
#' rawSample2 <- importWQP(url2, TRUE)
#' }
importWQP <- function(url, zip=FALSE){
importWQP <- function(url, zip=FALSE, tz=""){
h <- basicHeaderGatherer()
......@@ -45,7 +49,13 @@ importWQP <- function(url, zip=FALSE){
return(NA)
})
# if(headerInfo["Content-Type"] == "application/zip;charset=UTF-8"){
if(tz != ""){
tz <- match.arg(tz, c("America/New_York","America/Chicago",
"America/Denver","America/Los_Angeles",
"America/Anchorage","America/Honolulu",
"America/Jamaica","America/Managua",
"America/Phoenix","America/Metlakatla"))
}
numToBeReturned <- as.numeric(headerInfo["Total-Result-Count"])
......
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