R/sanitize_interaction.R

Defines functions sanitize_cross

sanitize_cross <- function(cross, variables, model) {
    checkmate::assert_flag(cross, null.ok = FALSE)

    if (isTRUE(cross) && is.null(variables)) {
        msg <- "When `cross = TRUE`, you must use the `variables` argument to specify which variables should be interacted."
        stop_sprintf(msg)
    }

    return(cross)
}

Try the marginaleffects package in your browser

Any scripts or data that you put into this service are public.

marginaleffects documentation built on Sept. 3, 2026, 9:08 a.m.