Make Dummy Variables from a Factor

Share:

Description

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

Usage

1

Arguments

x

an object coercable to factor.

Examples

1
2
x <- factor( rep( c("a", "b", "c", "d"), each=25 ) )
make_dummy(x)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.