convert_dummy_variable

convert_dummy_variable(y)

Arguments

y

a vector of numeric or character

Value

ggplot2 object

Author

Xiaotao Shen shenxt1990@outlook.com

Examples

y = c(rep("a", 3), rep("b", 3))
convert_dummy_variable(y)
#>      a b
#> [1,] 1 0
#> [2,] 1 0
#> [3,] 1 0
#> [4,] 0 1
#> [5,] 0 1
#> [6,] 0 1