diff --git a/R/variablesChartsSubgroups.R b/R/variablesChartsSubgroups.R index 97862a97..b60792e2 100644 --- a/R/variablesChartsSubgroups.R +++ b/R/variablesChartsSubgroups.R @@ -148,7 +148,7 @@ variablesChartsSubgroups <- function(jaspResults, dataset, options) { } # Check if all subgroups are of size 1 and return error if yes - if (all(apply(dataset[measurements], 1, function(x) sum(!is.na(x))) == 1)) { + if (all(apply(dataset[measurements], 1, function(x) sum(!is.na(x))) <= 1)) { plot <- createJaspPlot(title = gettext("Control charts"), width = 700, height = 400) plot$setError(gettext("All subgroups are of size 1. Variables charts for subgroups cannot be calculated. Use variables charts for individuals.")) jaspResults[["plot"]] <- plot