pos_first_unique | R Documentation |
This function extracts the position of the first appearance of each unique element in a vector. This is a simple wrapper for which
and duplicated
designed to improve code readability and reduce code length.
pos_first_unique(x)
x |
A vector. |
An integer vector of the positions in a vector at which each unique element appears for the first time.
Edward Lavender
pos_first_unique(c(1, 1, 1, 2, 4, 1, 2, 4, 9, 10, 1, 2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.