Learn R Programming

extracat (version 1.7-6)

imat: indicator variables

Description

converts a single categorical variable into indicator variables

Usage

imat(x, allcat = TRUE)

Arguments

x

A factor variable.

allcat

Whether or not to keep all categories or leave the last one out.

Value

matrix

Examples

Run this code
# NOT RUN {
require(MASS)
imat(housing$Type)
# }

Run the code above in your browser using DataLab