tuplicate {tuple} | R Documentation |
Find n-Replicated Elements
Description
Finds elements that occur exactly n times in a vector.
Usage
tuplicate(x, n)
Arguments
x |
A vector. |
n |
An integer. |
Details
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).
See Also
Examples
x <- c(NA, 1:3, 4:5, rep(6, 6), 3, NA, 4, 3, 3)
lapply(2:6, function(X) { tuplicate(x, X) })
[Package tuple version 0.4-02 Index]