dummyCodeFactorDf {kamila} | R Documentation |
Dummy coding of a data frame of factor variables
Description
Given a data frame of factor variables, this function returns a numeric matrix of 0–1 dummy-coded variables.
Usage
dummyCodeFactorDf(dat)
Arguments
dat |
A data frame of factor variables |
Value
A numeric matrix of 0–1 dummy coded variables
Examples
dd <- data.frame(a=factor(1:8), b=factor(letters[1:8]), stringsAsFactors = TRUE)
dummyCodeFactorDf(dd)
[Package kamila version 0.1.2 Index]