powered by
Given a data frame of factor variables, this function returns a numeric matrix of 0--1 dummy-coded variables.
dummyCodeFactorDf(dat)
A data frame of factor variables
A numeric matrix of 0--1 dummy coded variables
# NOT RUN { dd <- data.frame(a=factor(1:8), b=factor(letters[1:8]), stringsAsFactors = TRUE) dummyCodeFactorDf(dd) # }
Run the code above in your browser using DataLab