Commit d68d47f8 authored by Laura A DeCicco's avatar Laura A DeCicco
Browse files

Updated renameNWISColumns to work with rdb output.

parent b19773f8
dataRetrieval 2.4.0
==========
* Package readr now used for tab delimited parsing
* readr functions used to determine column types. Mostly, this produces the same results.
* In the case where there is text in a numeric column (specified by the RDB header), these now remain characters (previously was converted to numeric)
*
dataRetrieval 2.3.0
===========
* Converted all Water Quality Portal queries to sorted=no to greatly improve retrieval times
......
......@@ -45,6 +45,10 @@
#' url2 <- constructNWISURL(siteWithTwo, "00060",startDate,endDate,'dv')
#' twoResults <- importWaterML1(url2,TRUE)
#' twoResults <- renameNWISColumns(twoResults)
#' url2RDB <- constructNWISURL(siteWithTwo,"00060",
#' startDate,endDate,"dv",format="tsv")
#' rdbResults <- importRDB1(url2RDB)
#' rdbResults <- renameNWISColumns(rdbResults)
#' }
renameNWISColumns <- function(rawData, p00010="Wtemp", p00045="Precip",
p00060="Flow", p00065="GH", p00095="SpecCond", p00300="DO",
......@@ -78,7 +82,7 @@ renameNWISColumns <- function(rawData, p00010="Wtemp", p00045="Precip",
Conv$s00023<- "HiLoTide"
Conv$s00024<- "LoLoTide"
dataColumns <- grep("X_", Cnames)
dataColumns <- c(grep("X_", Cnames),grep("X\\d{2}", Cnames))
for (i in dataColumns){
chunks <- strsplit(Cnames[i], "_")[[1]]
......
......@@ -68,6 +68,10 @@ endDate <- "2012-10-01"
url2 <- constructNWISURL(siteWithTwo, "00060",startDate,endDate,'dv')
twoResults <- importWaterML1(url2,TRUE)
twoResults <- renameNWISColumns(twoResults)
url2RDB <- constructNWISURL(siteWithTwo,"00060",
startDate,endDate,"dv",format="tsv")
rdbResults <- importRDB1(url2RDB)
rdbResults <- renameNWISColumns(rdbResults)
}
}
\seealso{
......
Supports Markdown
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