From f9eb2b6939837a0c08b5b48ef5f1e5806f480daf Mon Sep 17 00:00:00 2001 From: JTPetter <61797391+JTPetter@users.noreply.github.com> Date: Thu, 16 Nov 2023 17:42:21 +0100 Subject: [PATCH] FIX: Include subgroup sizes smaller than 1 in error message --- R/variablesChartsSubgroups.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/variablesChartsSubgroups.R b/R/variablesChartsSubgroups.R index b60792e2..80338612 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) length(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