这是我的数据:
1 75,AAAAGAAAVANQGKK,[14] Acetyl (K)|[15] Acetyl (K)
2 192,AAAAGAAAVANQGKK,[14] Acetyl (K)|[15] Acetyl (K)
3 3770,AAFTKLDQVWGSE,[5] Acetyl (K)
4 934,AAIKFIKFINPKINDGE,[4] Acetyl (K)|[7] Acetyl (K)|[12] Acetyl (K)
5 1012,AAIKFIKFINPKINDGE,[4] Acetyl (K)|[7] Acetyl (K)|[12] Acetyl (K)
6 1970,AAIKFIKFINPKINDGE,[7] Acetyl (K)|[12] Acetyl (K)
我用逗号分隔它,但我想将它们全部放在不同的列中,每列都有一个标题。这就是我从整个数据集中获取这 3 个不同列的方法:
tbl_all_onlyK$concat <- paste(tbl_all_onlyK$id, tbl_all_onlyK$Sequence, tbl_all_onlyK$modifications, sep=",")
tbl_all_onlyK$concat <- data.frame(tbl_all_onlyK$concat)
也许有一种更简单的方法只是从数据中选择一些列,而不是通过concat
函数。