addCatVars | R Documentation |
Add dummy vars to data.frame
addCatVars(df, varnames, groupLetter = "D", mode = 1)
df |
A data.frame |
varnames |
Variable name to be converted as factor and add dummies |
groupLetter |
A character |
mode |
Numeric. One of 1:4. 1= simple indicator coding, 2= sequential coding, 3= Helmert coding, 4= effect coding |
mtcars1=addCatVars(mtcars,c("cyl","carb")) mtcars1[c(3:5),] mtcars2=addCatVars(mtcars,c("cyl","carb"),mode=3) mtcars2[c(3:5),] protest1=addCatVars(protest,"protest") head(protest1) iris1=addCatVars(iris,c("Species"),mode=3) (iris1[c(1,51,101),])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.