gpt4 book ai didi

r - 转换列表 r

转载 作者:行者123 更新时间:2023-12-02 04:34:39 24 4
gpt4 key购买 nike

抱歉可能重复,但我什至无法用语言描述我想要得到的东西。

这是我现在拥有的(列表列表)

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 - 转换列表 r,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44704748/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com