modelMatrix: Create a sparse design matrix from data frame

Description Usage Arguments

View source: R/modelMatrix.R

Description

modelMatrix takes in a data.frame and encodes it as a sparse model.Matrix object. Factors use treatment ("one-hot") encoding, creating indicator variables from categorical and binary variables. Note that names of categorical variables will change slightly (n-1 unique values appended to name)

Usage

1
modelMatrix(x, interactions = FALSE, intercept = FALSE)

Arguments

x

A data.frame with finite, non-missing elements.

interactions

Logical; if TRUE then all interactions included.

intercept

Logcal; if TRUE then include a leading column of 1's.


dhelkey/dghrank documentation built on April 21, 2020, 9:11 a.m.