Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gauge r&R (non-replicable) bug with certain datasets #344

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions R/msaGaugeRRnonrep.R
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,11 @@ msaGaugeRRnonrep <- function(jaspResults, dataset, options, ...) {

.gaugeNestedVarComponents <- function(dataset, operators, parts, measurements, ms) {
nOperators <- length(unique(dataset[[operators]]))
nReplicates <- with(dataset, table(dataset[[operators]], dataset[[parts]]))[1] # assuming constant repetitions across parts and operators
nParts <- as.vector(table(dataset[operators])[1] / nReplicates)
replicatesTable <- table(dataset[[parts]])
if (!all(replicatesTable == replicatesTable[1]))
stop("Unbalanced design. Some parts have more repeated measurements than others.")
nReplicates <- unname(replicatesTable)[1] # assuming constant repetitions across parts
nParts <- length(unique(dataset[[parts]]))
msOperator <- ms[1]
msOperatorPart <- ms[2]
msRepeat <- ms[3]
Expand Down
Loading