R语言中如何删除重复行

 

001、测试数据

root@PC1:/home/test3# ls
test.gff
root@PC1:/home/test3# cat test.gff    ## 测试数据
a b c
e j j
a b c
i j k
a b c
x y z
i q m
x y z
i e i

 

002、unique直接去除重复行

dat <- read.table("test.gff")
dat
unique(dat)

 

 

003、duplicated去重复

dat <- read.table("test.gff")
dat
dat[!duplicated(dat),]     ## 去重复

 

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