Split data frame string column into multiple columns
I’d like to take data of the form before = data.frame(attr = c(1,30,4,6), type=c(‘foo_and_bar’,’foo_and_bar_2′)) attr type 1 1 foo_and_bar 2 30 foo_and_bar_2 3 4 foo_and_bar 4 6 foo_and_bar_2 and use split() on the column “type” from above to get something like this: attr type_1 type_2 1 1 foo bar 2 30 foo bar_2 3 4 … Read more