Sometimes there can be terms in a formula that refer to a matrix instead of a single predictor. This function breaks up the matrix term into individual predictors to handle separately, as that is probably the intention of the user.
Arguments
- formula
A
formulafor a valid model.- data
The original
data.framewith a matrix as predictor.
Value
A list containing the expanded formula and the expanded
data.frame.