概述
duplicated(x, fromLast=FALSE, by=seq_along(x),)
- X : A data.table. uniqueN accepts atomic vectors and data.frames as well.
- fromLast : logical indicating if duplication should be considered from the reverse side, i.e., the last (or rightmost) of identical elements would correspond to duplicated = FALSE.
- by : character or integer vector indicating which combinations of columns from x to use for uniqueness checks. By default all columns are being used. That was changed recently for consistency to data.frame methods.
- returns a logical vector of length nrow(x) indicating which rows are duplicates.
duplicated(DT, by="B")
duplicated(DT, by=c("A", "C"))
duplicated(DT, by="B", fromLast=TRUE)
# 注意返回的是nrow(x)等长的包含逻辑值的向量
最后
以上就是笨笨啤酒为你收集整理的R -- duplicated函数的全部内容,希望文章能够帮你解决R -- duplicated函数所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复