Description Usage Arguments Value Examples
Creates a design matrix by expanding factors to a set of dummy variables.
1 | model_matrix(DT, ColNameFactor, other_class)
|
DT |
a data table contains the factors and the response. |
ColNameFactor |
a char vector with the name of the selected factor. |
other_class |
a char vector with the name of other classes than numeric (factor or char). |
return the value.
1 2 3 4 5 6 | library(data.table)
data(example_data)
m = model_matrix (example_data,
colnames(example_data)[-c(1:3)],
other_class = colnames(example_data)[14:23])
print(m)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.