Model_Matrix | R Documentation |
All factor levels included
Model_Matrix(
formula,
data = NULL,
mf = model.frame(formula, data = data),
allFactor = TRUE,
sparse = FALSE
)
formula |
formula |
data |
data frame |
mf |
model frame (alternative input instead of data) |
allFactor |
When TRUE all variables are coerced to factor |
sparse |
When TRUE sparse matrix created by sparse.model.matrix() |
Example:
z <- SSBtoolsData("sp_emp_withEU")
SSBtools:::Model_Matrix(~age*year + geo, z)
model matrix created via model.matrix() or sparse.model.matrix()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.