Skip to content

Commit

Permalink
Add moderated moderation for model number input
Browse files Browse the repository at this point in the history
  • Loading branch information
maltelueken authored and ThijsVroegh committed Aug 28, 2023
1 parent 63d8d4a commit 7b49e46
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions R/classicProcess.R
Original file line number Diff line number Diff line change
Expand Up @@ -211,18 +211,21 @@ ClassicProcess <- function(jaspResults, dataset = NULL, options) {
pathVars <- regList[[i]][["vars"]]

# Split path interactions
pathVarsSplit <- .strsplitColon(pathVars)

pathVarsSplit <- strsplit(pathVars, ":|__") # split according to `:` or `__`
isThreeWayInt <- grepl("__", pathVars)

# Replace dummy vars for each term of interactions separately
pathVarsSplit <- lapply(pathVarsSplit, .replaceDummyVars)

# Paste interaction terms back together
regList[[i]][["vars"]] <- sapply(pathVarsSplit, paste, collapse = ":")
pathVars[!isThreeWayInt] <- unlist(sapply(pathVarsSplit[!isThreeWayInt], paste, collapse = ":"))
pathVars[isThreeWayInt] <- unlist(sapply(pathVarsSplit[isThreeWayInt], paste, collapse = "__"))
regList[[i]][["vars"]] <- pathVars
}

# Replace dummy variables in dependent variables
names(regList) <- .replaceDummyVars(names(regList))

return(regList)
}

Expand Down

0 comments on commit 7b49e46

Please sign in to comment.