Learn R Programming

ZIprop (version 0.1.1)

fact2mat: Turn factor into multiple column

Description

Turns a factor with several levels into a matrix with several columns composed of zeros and ones.

Usage

fact2mat(x)

Arguments

x

a vector.

Value

Columns with zeros and ones.

Examples

Run this code
# NOT RUN {
x = sample(1:3,100,replace = TRUE)
fact2mat(x)
# }

Run the code above in your browser using DataLab