build_allowed_matrix: Build an allowed interaction matrix

View source: R/build_allowed.R

build_allowed_matrixR Documentation

Build an allowed interaction matrix

Description

Creates a symmetric logical matrix indicating which pairs of predictors are allowed to interact. By default, all interactions are allowed.

Usage

build_allowed_matrix(variable_names, default = TRUE)

Arguments

variable_names

Character vector of predictor variable names.

default

Logical. Default value for all entries. Default is TRUE (all interactions allowed).

Value

A symmetric logical matrix with variable_names as both row and column names.

Examples

mat <- build_allowed_matrix(c("sqft", "bedrooms", "pool"))
mat["sqft", "pool"] <- FALSE
mat["pool", "sqft"] <- FALSE
mat

earthUI documentation built on March 26, 2026, 1:07 a.m.