formula_has_interaction: Check whether a variable participates in a formula...

View source: R/utilities.R

formula_has_interactionR Documentation

Check whether a variable participates in a formula interaction

Description

Check whether a variable participates in a formula interaction

Usage

formula_has_interaction(formula, variable)

Arguments

formula

A model formula.

variable

Character, the name of the variable to check.

Details

Uses expanded model terms, so interactions removed with - do not count. Arithmetic inside I() is not treated as a formula interaction.

Value

A single logical value indicating whether an interaction term involves variable, including through a transformation such as factor(variable).


rbmi documentation built on Nov. 6, 2026, 1:06 a.m.