Create dummy variables within a tibble
dummify(dat, sel)
A tibble
with the data.
A character vector with the name(s) of the variables to be dummied.
tibble with dummy variables
mytest=data.frame(A=factor(c('a','a','b','c','c')), B=1:5)
dummify(mytest,"A")
#> # A tibble: 5 × 4
#> `A:a` `A:b` `A:c` B
#> <dbl> <dbl> <dbl> <int>
#> 1 1 0 0 1
#> 2 1 0 0 2
#> 3 0 1 0 3
#> 4 0 0 1 4
#> 5 0 0 1 5