Skip to content

Commit

Permalink
Merge pull request #296 from ldecicco-USGS/master
Browse files Browse the repository at this point in the history
noDataValue used better
  • Loading branch information
ldecicco-USGS authored Dec 15, 2016
2 parents 18d5f13 + 1458f14 commit e686b61
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: dataRetrieval
Type: Package
Title: Retrieval Functions for USGS and EPA Hydrologic and Water Quality Data
Version: 2.6.5
Date: 2016-12-14
Version: 2.6.6
Date: 2016-12-15
Authors@R: c( person("Robert", "Hirsch", role = c("aut"),
email = "[email protected]"),
person("Laura", "DeCicco", role = c("aut","cre"),
Expand Down
2 changes: 1 addition & 1 deletion R/importWaterML1.r
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ importWaterML1 <- function(obs_url,asDateTime=FALSE, tz=""){
#replace no data vals with NA, change attribute df
noDataVal <- as.numeric(varText$noDataValue)
if(nObs > 0){
obsDF[obsDF$values == noDataVal] <- NA
obsDF[[obsColName]][obsDF[[obsColName]] == noDataVal] <- NA
}
varText$noDataValue <- NA

Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/tests_userFriendly_fxns.R
Original file line number Diff line number Diff line change
Expand Up @@ -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_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")
Expand Down

0 comments on commit e686b61

Please sign in to comment.