index_func | R Documentation |
For when you want to know which occurence a value is in a vector and not just the number of times that it was duplicated.
index_func(a)
a |
A vector or column in a data frame |
A vector of counts that increase with each appearance of a value in a vector.
library(dplyr)
library(tibble)
foo <- tibble::tribble(
~numbers, ~numbers2,
4L, 4L,
23L, 23L,
4L, 4L,
23L, 23L,
5L, 5L,
43L, 43L,
54L, 54L,
56L, 56L,
657L, 657L,
67L, 67L,
67L, 67L,
435L, 435L,
453L, 453L,
435L, 435L,
324L, 324L,
34L, 34L,
456L, 456L,
56L, 56L,
567L, 567L,
65L, 65L,
34L, 34L,
435L, 435L
)
foo %>%
mutate(index = index_func(numbers))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.