I have the following dataframe:
A B C D E F G
1/2 3/4 4/5/6 7/8 9/10 11 12/13/14/15
And want to split to:
A B C D E F G
1 3 4 7 9 11 12
2 4 5 8 10 NA 13
NA NA 6 NA NA NA 14
NA NA NA NA NA NA 15
Is there any compact way to do it?
I've tought about separating each column into a list, using something such as
list_of_dfs
and for each df do:
modified_dfs %>% separate_rows(colnames(each_df), sep = "/")
then doing a merge of all dataframes created in the process...
merge(modified_dfs)