enum | R Documentation |
This function enumerates the values of an input vector x
,
counting along the length of the vector from 1 to length(x)
.
enum(x, inPlace = TRUE, sep = ":")
x |
The input vector to enumrate. Must be a vector (either atomic, or a |
inPlace |
Should the numbers be pasted onto the original vector? Defaults to Must be a singleton |
sep |
Separator between numbers and vector. Defaults to Can be empty string ( |
If inPlace = TRUE
(and x
is atomic), the original vector is returned with the counts
pasted to the front of each value, separated by sep
.
If inPlace = FALSE
, a new integer
vector is returned, identical to calling seq_along(x).
enum(letters)
enum(letters, inPlace = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.