diff --git a/R/showAreaAndBarPlots.R b/R/showAreaAndBarPlots.R index a97f9fa..30c8daa 100644 --- a/R/showAreaAndBarPlots.R +++ b/R/showAreaAndBarPlots.R @@ -98,6 +98,11 @@ showAreaAndBarPlots <- function( return(invisible(NULL)) } + if (!mainReg %in% unique(d$region)) { + warning("Main region not found in data. Nothing to plot.", call. = FALSE) + return(invisible(NULL)) + } + switch( orderVars, mean = {