Is there a function/ way to generate dummy variable in Julia
similar to R
? I know I can use RCall
package and create the dummy variable then use @rget
but I'm looking for an alternative in Julia.
x1=string.([2 ,1 ,2, 1, 2 ,1 ,1 ,3, 2, 2])
x2=string.([1 ,1 ,3, 2, 2, 2 ,1 ,2, 1, 2])
R"""
library(qdapTools)
df = data.frame(catg1 = $x1, catg2= $x2)
dum_var=cbind(mtabulate(df$catg1), mtabulate(df$catg2))
"""