View source: R/factor_to_dummy.R
factor_to_dummy | R Documentation |
Creation of dummy variables and reverse
factor_to_dummy(x)
dummy_to_factor(x, value = 1L)
x |
data.frame all 0 / 1 |
value |
integer |
data.frame
factor
z <- gl(3, 2, 12, labels = c("apple", "salad", "orange"))
table(z)
levels(z) <- list("veg" = "salad", "fruit" = c("apple", "orange"))
table(z)
z <- factor_to_dummy(z)
table(z)
z <- dummy_to_factor(z)
table(z)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.