View source: R/transfo_quali.R
transfo_quali | R Documentation |
A function that transforms a factor of n(>1) levels in (n-1) binary variables.
transfo_quali(x, labx = NULL)
x |
a factor |
labx |
a new label for the generated binary variables (By default the name of the factor is conserved) |
A matrix of (n-1) binary variables
Gregory Guernec
treat <- as.factor(c(rep("A", 10), rep("B", 15), rep("C", 12))) treat_bin <- transfo_quali(treat, "trt")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.