【发布时间】:2018-08-15 21:29:40
【问题描述】:
我在选择 R 中的重复行时遇到问题。数据名有 14 列和 100 万行。我必须进行行比较,即找出相同的行,这将是重复的。我想通过这种方法得到重复的行。我的数据框就像 Data frame sample
最后两行相同,因此需要将其标记为标志值 1。 我不知道如何开始。
这些代码我都试过了,
df <- unique(data[,1:97]) //this method gives me unique set not number of duplicates.
dim(data[duplicated(data),])[1] // this method gives me the number of duplicates but not ids.
我需要知道重复的 ID。
我的意图是检查每一行并写下重复行的总数或行号。
【问题讨论】:
-
@dww 我已经提到了这个问题。它可以删除特定的行和列值,但我需要对整行执行此操作。我已经在我的数据样本中链接了。
标签: r comparison rowcount