Description Usage Arguments Value Examples
View source: R/Mfx_functions.R
easily convert a k-level factor variable to k binary variables
1 |
y |
a factor variable with at least 2 levels |
a matrix of k binary columns, one corresponding to each level of
the input, y
1 2 3 4 5 6 7 | my_factor <- c("bob", "sharron", "bob", "alice", "alice")
my_factor <- as.factor(my_factor)
my_binary_matrix <- Factor2Binary(my_factor)
my_binary_matrix
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.