Suppose I have the following dataframe, called 'example':
a <- c("rs123|rs246|rs689653", "rs9753", "rs00334")
b <- c(1,2,9)
c <- c(234534523, 67345634, 536423)
example <- data.frame(a,b,c)
I want the dataframe to look like this:
a b c
rs123 1 234534523
rs246 1 234534523
rs689653 1 234534523
rs9753 2 67345634
rs00334 9 536423
Where if we split column a on the |
delimiter, the other columns are duplicated. Any help would be greatly appreciated!!