{
##### Example 1 -------------------------------------------------------------
# add an index for the tibble
add_index(iris, "my_index")
##### Example 2 -------------------------------------------------------------
# add an index for the grouped tibble
library(tidyr)
library(dplyr)
my_tbl <- tibble(iris) %>% group_by(Species) %>% slice(1:3)
add_index(my_tbl, "my_index")
}
Run the code above in your browser using DataLab