Skip to content

Commit fa3c20f

Browse files
committed
fix order in interactions
1 parent 9e5b369 commit fa3c20f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

R/anovarepeatedmeasures.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,16 @@ AnovaRepeatedMeasuresInternal <- function(jaspResults, dataset = NULL, options)
197197
termsRM.base64 <- c()
198198
termsRM.normal <- c()
199199

200+
mainEffects <- unlist(lapply(options$withinModelTerms, function(term) {
201+
if (length(term$components) == 1) term$components
202+
}))
203+
200204
for (term in options$withinModelTerms) {
201205

202206
components <- unlist(term$components)
207+
if (length(components) > 1) # make sure that interaction gets defined in same order as model terms
208+
components <- mainEffects[mainEffects %in% components]
209+
203210
termRM.base64 <- paste(.v(components), collapse=":", sep="")
204211
termRM.normal <- paste(components, collapse=" \u273B ", sep="")
205212

0 commit comments

Comments
 (0)