我有一个txt文件,数据如下所示。我想将其导入R。
Sequences ( 1: 2) %id: 8 Score: 10 Len: 1
Sequences ( 1: 10) %id: 25 Score: 30 Len: 3
Sequences ( 61: 624) %id: 75 Score: 90 Len: 12
Sequences ( 61: 625) %id: 33 Score: 40 Len: 12
Sequences ( 860: 939) %id: 41 Score: 50 Len: 7
Sequences ( 860: 940) %id: 16 Score: 20 Len: 6
Sequences (1248:1395) %id: 8 Score: 10 Len: 1
Sequences (1248:1396) %id: 33 Score: 40 Len: 8
当我使用read.table
时df<-read.table("seq_TEXT INPUT_text.txt",sep = " ", header = F, fill = TRUE)
我希望结果看起来像
V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15
Sequences ( 1 : 2 ) %id : 8 Score : 10 Len : 1
Sequences ( 1 : 10 ) %id : 25 Score : 30 Len : 3
Sequences ( 61 : 624 ) %id : 75 Score : 90 Len : 12
Sequences ( 61 : 625 ) %id : 33 Score : 40 Len : 12
Sequences ( 860 : 939 ) %id : 41 Score : 50 Len : 7
Sequences ( 860 : 940 ) %id : 16 Score : 20 Len : 6
Sequences (1248 :1395 ) %id : 8 Score : 10 Len : 1
Sequences (1248 :1396 ) %id : 33 Score : 40 Len : 8
我们怎么能这样做? 提前谢谢。