Rfast (version 1.7.3)

Design Matrix : Design Matrix

Description

Design Matrix.

Usage

design_matrix(x, ones = TRUE)

Arguments

x
A character vector or a factor type vector. Do not supply a numerical vector.
ones
A boolean variable specifying whether to include the ones in the design matrix or not. The default value is TRUE.

Value

Returns the same matrix with model.matrix.

Details

This function implements the R's "model.matrix" function and is used only when the x is a factor.

See Also

model.matrix

Examples

Run this code
a <- design_matrix( iris[, 5] )
b <- model.matrix( ~ iris[,5] )  ## R's built-in funciton

Run the code above in your browser using DataLab