Learn R Programming

Kmisc (version 0.5.0)

make_dummy: Make Dummy Variables from a Factor

Description

This functions converts a single factor into dummy variables, with one dummy variable for each level of that factor. Names are constructed as _.

Usage

make_dummy(x)

Arguments

x
an object coercable to factor.

Examples

Run this code
x <- factor( rep( c("a", "b", "c", "d"), each=25 ) )
make_dummy(x)

Run the code above in your browser using DataLab