# NOT RUN {
library(mojson)
# levels are identical.
df1 <- data.frame(a = c('ab@gmail.com', 'cd@gmail.com'),
b = c(TRUE, FALSE))
expanddf(df1, 'a', '@')
# change the separator and treat various levels.
df2 <- data.frame(a = c('1-2-0', '1-2-0-3', '1-2'),
b = c(TRUE, FALSE, TRUE))
expanddf(df2, 'a', '-')
# }
Run the code above in your browser using DataLab