View source: R/misc_functions.R
dummyCodeFactorDf | R Documentation |
Given a data frame of factor variables, this function returns a numeric matrix of 0–1 dummy-coded variables.
dummyCodeFactorDf(dat)
dat |
A data frame of factor variables |
A numeric matrix of 0–1 dummy coded variables
dd <- data.frame(a=factor(1:8), b=factor(letters[1:8]), stringsAsFactors = TRUE)
dummyCodeFactorDf(dd)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.