R语言读取数据如何跳过文件的前几行

 

001、测试数据

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

 

dir()
dat1 <- read.table("test.gff", header = F)
dat1
dat2 <- read.table("test.gff", header = F, skip = 1)    ## 跳过文件的第一行
dat2
dat3 <- read.table("test.gff", header = F, skip = 3)    ## 跳过文件的前三行
dat3

 

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