first | R Documentation |
Identify the first elements of series of repeated values.
first(x)
x |
A vector whose values will be explored for series of repeated values, can be character, numeric, or factor. |
An integer vector the same length as x
, with a 1 for every element
that is different than the one before it, and a 0 for every element
that is the same as the one before it.
first(c(1, 2, 1, 2, 2, 1, 1, 3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.