Skip to content

Commit

Permalink
add sanity check to showAreaAndBarPlots
Browse files Browse the repository at this point in the history
  • Loading branch information
fbenke-pik committed Feb 9, 2024
1 parent e3cc350 commit 8327b2b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions R/showAreaAndBarPlots.R
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 8327b2b

Please sign in to comment.