抱歉,可能会重复,但我什至无法用文字描述我想要得到的东西。
这就是我现在所拥有的(列表列表)
id1 one; two; three
id2 one
id3 one; two; three; four
id4 one; two
我需要得到什么
id1 one
id1 two
id1 three
id2 one
id3 one
等等...帮助。
我需要这个来从UniProt检索ID表创建Blast2GO定制.annot文件。
最佳答案
我们可以为此使用cSplit
library(splitstackshape)
cSplit(df1, 'col2', ';', 'long')
注意:假定第二列名称为“col2”,对象名称为“df1”
关于r - 转换列表,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/44704748/