From 3b3fe7ea1c0816671210371bda8e287ace5e1e99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20Holl=C3=B3s?= Date: Mon, 12 Oct 2020 10:09:07 +0200 Subject: [PATCH] fix plotMuso bug --- RBBGCMuso/R/plotMuso.R | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/RBBGCMuso/R/plotMuso.R b/RBBGCMuso/R/plotMuso.R index 50da339..8d908b3 100644 --- a/RBBGCMuso/R/plotMuso.R +++ b/RBBGCMuso/R/plotMuso.R @@ -115,7 +115,6 @@ plotMuso <- function(settings = NULL, variable = "all", if(!inherits(musoData$date[1], "Date")){ musoData$date<- as.Date(as.character(musoData$date),"%d.%m.%Y") } - if(!expandPlot){ if(plotType=="cts"){ if(length(variableName)==1){ @@ -191,13 +190,16 @@ plotMuso <- function(settings = NULL, variable = "all", } - variableName <- as.character(settings$outputVars[[1]])[variable] + if(variable == "all"){ + variableName <- as.character(settings$outputVars[[1]]) + } if(is.character(variable)){ if(identical(variable,"all")){ variable <- as.character(settings$outputVars[[1]]) + } else { if(is.element(variable, settings$dailyVarCodes)){ @@ -230,7 +232,7 @@ plotMuso <- function(settings = NULL, variable = "all", print(numVari) stop("Not all members of the variable parameter are among the output variables") }} - + pointOrLineOrPlot(musoData = musoData, variableName = variableName, plotType = plotType,