Commit ce3f69dc authored by Laura A DeCicco's avatar Laura A DeCicco Committed by GitHub
Browse files

Merge pull request #243 from ldecicco-USGS/master

version
parents ea89c3db fdd23dbb
Package: dataRetrieval
Type: Package
Title: Retrieval Functions for USGS and EPA Hydrologic and Water Quality Data
Version: 2.5.9
Version: 2.5.10
Date: 2016-06-14
Authors@R: c( person("Robert", "Hirsch", role = c("aut"),
email = "rhirsch@usgs.gov"),
......@@ -12,7 +12,9 @@ Authors@R: c( person("Robert", "Hirsch", role = c("aut"),
person("Jordan", "Read", role = c("ctb"),
email = "jread@usgs.gov"),
person("Lindsay","Carr", role=c("ctb"),
email = "lcarr@usgs.gov"))
email = "lcarr@usgs.gov"),
person("David","Watkins", role=c("ctb"),
email = "wwatkins@usgs.gov"))
Description: Collection of functions to help retrieve U.S. Geological Survey
(USGS) and U.S. Environmental Protection Agency (EPA) water quality and
hydrology data from web services. USGS web services are discovered from the
......
......@@ -65,7 +65,6 @@ importFrom(lubridate,parse_date_time)
importFrom(readr,col_character)
importFrom(readr,col_number)
importFrom(readr,cols)
importFrom(readr,parse_number)
importFrom(readr,problems)
importFrom(readr,read_delim)
importFrom(readr,read_lines)
......
......@@ -37,7 +37,8 @@ getWebServiceData <- function(obs_url, ...){
if(headerInfo$`content-type` == "text/tab-separated-values;charset=UTF-8"){
returnedDoc <- content(returnedList, type="text",encoding = "UTF-8")
} else if (headerInfo$`content-type` == "text/xml;charset=UTF-8"){
} else if (headerInfo$`content-type` %in% c("text/xml;charset=UTF-8",
"text/xml")){
returnedDoc <- xmlcontent(returnedList)
} else if (headerInfo$`content-type` == "text/html"){
txt <- readBin(returnedList$content, character())
......
......@@ -47,8 +47,8 @@
#' @importFrom readr read_lines
#' @importFrom readr read_delim
#' @importFrom readr problems
#' @importFrom readr parse_number
#' @importFrom lubridate fast_strptime
#' @importFrom lubridate parse_date_time
#' @examples
#' siteNumber <- "02177000"
#' startDate <- "2012-09-01"
......@@ -166,12 +166,8 @@ importRDB1 <- function(obs_url, asDateTime=TRUE, convertType = TRUE, tz=""){
if(all(c(paste0(i,"_dt"),paste0(i,"_tm")) %in% header.names)){
varname <- paste0(i,"_dateTime")
if("lt" %in% names(formals(fast_strptime))){
varval <- fast_strptime(paste(readr.data[,paste0(i,"_dt")],readr.data[,paste0(i,"_tm")]), "%Y-%m-%d %H:%M", tz = "UTC", lt=FALSE)
} else {
varval <- fast_strptime(paste(readr.data[,paste0(i,"_dt")],readr.data[,paste0(i,"_tm")]), "%Y-%m-%d %H:%M", tz = "UTC")
}
varval <- as.POSIXct(fast_strptime(paste(readr.data[,paste0(i,"_dt")],readr.data[,paste0(i,"_tm")]), "%Y-%m-%d %H:%M", tz = "UTC"))
if(!all(is.na(varval))){
readr.data[,varname] <- varval
......@@ -203,7 +199,7 @@ importRDB1 <- function(obs_url, asDateTime=TRUE, convertType = TRUE, tz=""){
if(all(c("DATE","TIME","TZCD") %in% header.names)){
varname <- "DATETIME"
varval <- fast_strptime(paste(readr.data[,"DATE"],readr.data[,"TIME"]), "%Y-%m-%d %H%M%S", tz = "UTC", lt=FALSE)
varval <- as.POSIXct(fast_strptime(paste(readr.data[,"DATE"],readr.data[,"TIME"]), "%Y-%m-%d %H%M%S", tz = "UTC"))
readr.data[,varname] <- varval
readr.data <- convertTZ(readr.data,"TZCD",varname,tz, flip.cols=TRUE)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment