duplicateof | R Documentation |
This replaces all values with the index of their first occurrence.
duplicateof(x, na.first = FALSE)
x |
A vector. |
na.first |
Logical value indicating whether to replace the first
occurrence of each value with its index (if |
A vector of the length of x
with each value representing either
NA
if it is the first occurrence of a unique value, or
the index of the first instance of each value in x
if it is a duplicated value.
Sercan Kahveci
duplicateof(c("a","b","a","k"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.