powered by
function from dummies package
dummy(x, data = NULL, sep = "", drop = TRUE, fun = as.integer, verbose = FALSE)