Skip to content

Commit

Permalink
Include subgroups sizes smaller than 1 in error message
Browse files Browse the repository at this point in the history
  • Loading branch information
JTPetter committed Nov 16, 2023
1 parent dc8534d commit 514d53e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/variablesChartsSubgroups.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 514d53e

Please sign in to comment.