R - Remove commas from values in a column and place separated values into new rows -


i have column of gene symbols have retrieved directly database, , of rows contain 2 or more symbols comma separated (see example below).

slc6a13 atp5j2-ptcd1,bud31,ptcd1 acot7 bud31,pdap1 ttc26 

i remove commas, , place separated symbols new rows so:

slc6a13 atp5j2-ptcd1 bud31 ptcd1 acot7 bud3 pdap1 ttc26 

i haven't been able find straight forward way in r, have suggestions?

another option use readlines , strsplit :

unlist(strsplit(readlines(textconnection(txt)),','))  "slc6a13"      "atp5j2-ptcd1" "bud31"        "ptcd1"        "acot7"          "bud31"        "pdap1"        "ttc26"   

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -