Learn R Programming

extracat (version 1.7-0)

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
require(MASS)
imat(housing$Type)

Run the code above in your browser using DataLab