Skip to content
Snippets Groups Projects
Commit 4f7d4192 authored by Laura A DeCicco's avatar Laura A DeCicco
Browse files

Fix for variableInfo attribute that comes back incomplete.

parent b075d091
No related branches found
No related tags found
1 merge request!59Error handling.
...@@ -358,13 +358,14 @@ importWaterML1 <- function(obs_url,asDateTime=FALSE, tz=""){ ...@@ -358,13 +358,14 @@ importWaterML1 <- function(obs_url,asDateTime=FALSE, tz=""){
siteInfo <- cbind(siteInfo, t(propertyValues)) siteInfo <- cbind(siteInfo, t(propertyValues))
names(extraVariableData) <- make.unique(names(extraVariableData)) names(extraVariableData) <- make.unique(names(extraVariableData))
variableInfo <- data.frame(parameterCd=extraVariableData$variableCode$text,
variableInfo <- c(parameterCd=extraVariableData$variableCode$text,
parameter_nm=extraVariableData$variableName, parameter_nm=extraVariableData$variableName,
parameter_desc=extraVariableData$variableDescription, parameter_desc=extraVariableData$variableDescription,
valueType=extraVariableData$valueType, valueType=extraVariableData$valueType,
param_units=extraVariableData$unit$unitCode, param_units=extraVariableData$unit$unitCode)
noDataValue=NA, #as.numeric(extraVariableData$noDataValue), since it's already converted
stringsAsFactors=FALSE) variableInfo <- data.frame(t(variableInfo), stringsAsFactors=FALSE)
statInfo <- data.frame(statisticName=statName, statInfo <- data.frame(statisticName=statName,
statisticCd=statCd, statisticCd=statCd,
...@@ -387,7 +388,7 @@ importWaterML1 <- function(obs_url,asDateTime=FALSE, tz=""){ ...@@ -387,7 +388,7 @@ importWaterML1 <- function(obs_url,asDateTime=FALSE, tz=""){
} }
###################### ######################
attList[[uniqueName]] <- list(extraSiteData, extraVariableData) attList[[uniqueName]] <- list(extraSiteData, extraVariableData)
...@@ -425,6 +426,7 @@ importWaterML1 <- function(obs_url,asDateTime=FALSE, tz=""){ ...@@ -425,6 +426,7 @@ importWaterML1 <- function(obs_url,asDateTime=FALSE, tz=""){
mergedDF <- data.frame() mergedDF <- data.frame()
} }
variableInformation$noDataValue <- rep(NA, nrow(variableInformation))
row.names(mergedDF) <- NULL row.names(mergedDF) <- NULL
attr(mergedDF, "url") <- obs_url attr(mergedDF, "url") <- obs_url
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment