Skip to content

Commit e686b61

Browse files
Merge pull request #296 from ldecicco-USGS/master
noDataValue used better
2 parents 18d5f13 + 1458f14 commit e686b61

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: dataRetrieval
22
Type: Package
33
Title: Retrieval Functions for USGS and EPA Hydrologic and Water Quality Data
4-
Version: 2.6.5
5-
Date: 2016-12-14
4+
Version: 2.6.6
5+
Date: 2016-12-15
66
Authors@R: c( person("Robert", "Hirsch", role = c("aut"),
77
email = "[email protected]"),
88
person("Laura", "DeCicco", role = c("aut","cre"),

R/importWaterML1.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ importWaterML1 <- function(obs_url,asDateTime=FALSE, tz=""){
279279
#replace no data vals with NA, change attribute df
280280
noDataVal <- as.numeric(varText$noDataValue)
281281
if(nObs > 0){
282-
obsDF[obsDF$values == noDataVal] <- NA
282+
obsDF[[obsColName]][obsDF[[obsColName]] == noDataVal] <- NA
283283
}
284284
varText$noDataValue <- NA
285285

tests/testthat/tests_userFriendly_fxns.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ test_that("Unit value data returns correct types", {
4040
"X_YSI.6136.DOWN_63680_00000","X_.YSI.6136.UP._63680_00000_cd",
4141
"X_YSI.6136.DOWN_63680_00000_cd","tz_cd")))
4242

43+
noData <- readNWISuv("01196500","00010", "2016-06-15", "2016-06-15")
44+
expect_equal(noData$X_00010_00000[1], as.numeric(NA))
45+
4346
})
4447

4548
context("Peak, rating, meas, site")

0 commit comments

Comments
 (0)