Learn R Programming

ZIprop (version 0.1.1)

model_matrix: Construct Design Matrix

Description

Creates a design matrix by expanding factors to a set of dummy variables.

Usage

model_matrix(DT, ColNameFactor, other_class)

Arguments

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).

Value

return the value.

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab