tuplicate {tuple} | R Documentation |
Finds elements that occur exactly n times in a vector.
tuplicate(x, n)
x |
A vector. |
n |
An integer. |
Returns the n-replicated elements in the same order that they would be
returned in a call to orphan
. This fundamentally
differs from tuplicated
, which returns
a logical vector that is TRUE
when it runs into any but
the (n-1)
-st and fewer occurrences of an element
(and is therefore dependent on the direction of testing of the vector).
x <- c(NA, 1:3, 4:5, rep(6, 6), 3, NA, 4, 3, 3)
lapply(2:6, function(X) { tuplicate(x, X) })