powered by
tiepos returns the positions of those elements that participate in ties.
tiepos
tiepos(x, ...)# S3 method for integer64 tiepos(x, nties = NULL, method = NULL, ...)
# S3 method for integer64 tiepos(x, nties = NULL, method = NULL, ...)
an integer vector of positions
This function automatically chooses from several low-level functions considering the size of x and the availability of a cache.
x
Suitable methods are
sortordertie (fast ordering)
sortordertie
ordertie (memory saving ordering).
ordertie
rank.integer64() for possibly tied ranks and unipos.integer64() for positions of unique values.
rank.integer64()
unipos.integer64()
x <- as.integer64(sample(c(rep(NA, 9), 1:9), 32, TRUE)) tiepos(x) stopifnot(identical(tiepos(x), (1:length(x))[duplicated(x) | rev(duplicated(rev(x)))]))
Run the code above in your browser using DataLab