which.duplicate | R Documentation |
which.duplicate() determines for each element of a vector how many times its value has occurred so far.
which.duplicate(x)
x |
A vector. |
It works similarly to [base::duplicated()] which only determines whether a value has occurred before and not how many times.
A vector of the same length as x
, where each element represents
the number of times the value in the same position in x
has been repeated so far.
Sercan Kahveci
which.duplicate(c(1,6,5,2,1,1,8,6,5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.