Commit b06d1f8c authored by David Watkins's avatar David Watkins
Browse files

numeric NAs

parent 45f933c0
......@@ -210,7 +210,7 @@ importWaterML2 <- function(input, asDateTime=FALSE, tz="UTC") {
uom = uom, comment = comment)
df_use <- df_vars[sapply(df_vars, function(x){length(x) > 0 && !all(is.na(x))})]
df <- data.frame(df_use, stringsAsFactors = FALSE)
if(!"value" %in% names(df)) {df$value <- NA}
if(!"value" %in% names(df)) {df$value <- as.numeric(NA)}
#from the default metadata section
#append to existing attributes if they aren't empty
mdAttribs <- list(defaultQualifier=defaultQuals, defaultUOM=defaultUOM,
......
......@@ -188,12 +188,11 @@ test_that("importWaterML2 external test", {
xml <- getWebServiceData(url)
measurementTS2 <- xml2::xml_find_all(xml, "//wml2:MeasurementTimeseries")
exData <- importWaterML2(measurementTS2)
expect_is(exData$value, c('numeric', 'logical'))
expect_is(exData$value, 'numeric')
expect_gt(nrow(exData),0)
})
context("importWQP_noCRAN")
test_that("External WQP tests", {
......
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