I have a dataset where one row somtimes corresponds to two or more data points, as indicated by a comma seperation in one column. For example:
identifier pos name
ENSG00000208234 1 foo
ENSG00000199674 5,8 bar
ENSG00000221622 4 foobar
I want to expand this the following way
identifier pos name
ENSG00000208234 1 foo
ENSG00000199674 5 bar
ENSG00000199674 8 bar
ENSG00000221622 4 foobar
Is there a way that does not involve iterating through each row and creating a new data.frame?
Thanks