I have a data like this
> a<-data.table(col1=c(1,2,3),col2=c("1;2","11;22","111;333"))
> a
col1 col2
1: 1 1;2
2: 2 11;22
3: 3 111;333
and I want to get it to the following format
col1 col2
1: 1 1
2: 2 11
3: 3 111
4: 1 2
5: 2 22
6: 3 333
for which something like a %>% mutate(col1=strplit(...,";"), col2=strplit(...,";"))
should work in a dplyr/tidyr way for data.frame but now data.table.
How to transform a data.table like the above by splitting the values?