duplicated() determines which elements of a vector or data frame are duplicates
of elements with smaller subscripts, and returns a logical vector
indicating which elements (rows) are duplicates.
# S3 method for class 'integer64'
duplicated(x, incomparables = FALSE, nunique = NULL, method = NULL, ...)a vector or a data frame or an array or NULL.
ignored
NULL or the number of unique values (including NA). Providing
nunique can speed-up matching when x has no cache. Note that a wrong
nunique can cause undefined behaviour up to a crash.
NULL for automatic method selection or a suitable low-level method, see details
ignored
duplicated(): a logical vector of the same length as x.
This function automatically chooses from several low-level functions
considering the size of x and the availability of a cache.
Suitable methods are
hashdup (hashing)
sortorderdup (fast ordering)
orderdup (memory saving ordering).
x <- as.integer64(sample(c(rep(NA, 9), 1:9), 32, TRUE))
duplicated(x)
#> [1] FALSE TRUE TRUE TRUE TRUE FALSE FALSE TRUE FALSE TRUE TRUE TRUE
#> [13] FALSE FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE FALSE FALSE TRUE
#> [25] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
stopifnot(identical(duplicated(x), duplicated(as.integer(x))))