R语言中如何读取列数不一致的数据

 

001、测试数据

root@PC1:/home/test3# ls
test.gff
root@PC1:/home/test3# cat test.gff
aa bb xx yy
jj kk
mm
ee ww qq kk uu
xx ff ee

 

dir()
dat1 <- read.table("test.gff", header = F)
dat2 <- read.table("test.gff", header = F, fill = T)  ## 增加fill = T参数,读取列数不一致的数据
dat2
dat2$V2
dat2[2,]

 

posted @ 2022-07-27 21:09  小鲨鱼2018  阅读(364)  评论(0编辑  收藏  举报