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

Merge pull request #296 from ldecicco-USGS/master

noDataValue used better
parents 18d5f139 1458f14b
Package: dataRetrieval Package: dataRetrieval
Type: Package Type: Package
Title: Retrieval Functions for USGS and EPA Hydrologic and Water Quality Data Title: Retrieval Functions for USGS and EPA Hydrologic and Water Quality Data
Version: 2.6.5 Version: 2.6.6
Date: 2016-12-14 Date: 2016-12-15
Authors@R: c( person("Robert", "Hirsch", role = c("aut"), Authors@R: c( person("Robert", "Hirsch", role = c("aut"),
email = "rhirsch@usgs.gov"), email = "rhirsch@usgs.gov"),
person("Laura", "DeCicco", role = c("aut","cre"), person("Laura", "DeCicco", role = c("aut","cre"),
......
...@@ -279,7 +279,7 @@ importWaterML1 <- function(obs_url,asDateTime=FALSE, tz=""){ ...@@ -279,7 +279,7 @@ importWaterML1 <- function(obs_url,asDateTime=FALSE, tz=""){
#replace no data vals with NA, change attribute df #replace no data vals with NA, change attribute df
noDataVal <- as.numeric(varText$noDataValue) noDataVal <- as.numeric(varText$noDataValue)
if(nObs > 0){ if(nObs > 0){
obsDF[obsDF$values == noDataVal] <- NA obsDF[[obsColName]][obsDF[[obsColName]] == noDataVal] <- NA
} }
varText$noDataValue <- NA varText$noDataValue <- NA
......
...@@ -40,6 +40,9 @@ test_that("Unit value data returns correct types", { ...@@ -40,6 +40,9 @@ test_that("Unit value data returns correct types", {
"X_YSI.6136.DOWN_63680_00000","X_.YSI.6136.UP._63680_00000_cd", "X_YSI.6136.DOWN_63680_00000","X_.YSI.6136.UP._63680_00000_cd",
"X_YSI.6136.DOWN_63680_00000_cd","tz_cd"))) "X_YSI.6136.DOWN_63680_00000_cd","tz_cd")))
noData <- readNWISuv("01196500","00010", "2016-06-15", "2016-06-15")
expect_equal(noData$X_00010_00000[1], as.numeric(NA))
}) })
context("Peak, rating, meas, site") context("Peak, rating, meas, site")
......
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