read.table,在R中具有已定义的列数

时间:2015-12-08 20:32:50

标签: r read.table

假设我有一个原始文本文件f.txt,如下所示:

100040390   mmu04120:Ubiquitin mediated proteolysis
100040390   mmu05020:Parkinson's disease
100163  mmu00565:Ether lipid metabolism

如果我执行read.table(f.txt),它会自动按标签/空格分隔:

    V1               V2                V3         V4
1 100040390   mmu04120:Ubiquitin     mediated proteolysis                     
2 100040390 mmu05020:Parkinson's      disease                                 
3    100163       mmu00565:Ether        lipid  metabolism 

我的问题是如何将其读入r,其中有2列,例如:

    V1               V2              
1 100040390   mmu04120:Ubiquitin mediated proteolysis                     
2 100040390   mmu05020:Parkinson's disease                                 
3    100163   mmu00565:Ether lipid metabolism 

0 个答案:

没有答案