makeIndicator: Make indicator variables for each levels in a categorical...

Description Usage Arguments Value Examples

View source: R/data_manipulation.R

Description

Make indicator variables for each levels in a categorical variable.

Usage

1

Arguments

x

a character vector of a categorical variable.

levels

a character vector of unique levels in x.

Value

a data frame of indicator variables of each level in the categorical variable x.

Examples

1
2
3
data(Queensland)
makeIndicator(Queensland[,polActivitiesRaw], c("boycot","union","demonstration","internet","paper","volunteer"))
makeIndicator(Queensland[,"previousVoteRaw"], c("Liberal","Greens","Katter","Labor"))

uyenhoang/pplpredict documentation built on May 3, 2019, 2:41 p.m.