modelmatrix: Create model matrix from formula

View source: R/helper.R

modelmatrixR Documentation

Create model matrix from formula

Description

Extracts model matrix from formula, optionally separating response variables from predictors. Removes intercept column and cleans column names.

Usage

modelmatrix(f, data = NULL)

Arguments

f

Formula object

data

Data frame (optional)

Value

Model matrix or list of matrices (y and x) if response present


reportRmd documentation built on March 20, 2026, 5:06 p.m.