I have a data frame like this -
uniq = data.frame(Freq = c(172,4,50,3),
seq = c("G","G G T G T","G G T T","T G T T A T T"))
I want to split the second column into multiple columns without any repetitions. The string in separated by spaces.
I tried using the code below but this duplicates values from smaller string to the length of the longer string -
within(uniq, uniq_seq <-data.frame(do.call('rbind', strsplit(as.character(uniq[,2]), ' '))))
Thanks for your help!