Goal: I would like to create a numeric list based on the starting value in another column (seqnbr), then unnest it.
In the data below a nested c(1:10) sequence would begin on the column seqnbr.
x <- tibble(name = c('boo', 'bah', 'bee'),
seqnbr = c(1,2,3))
A tibble: 3 x 2
name seqnbr
<chr> <dbl>
1 boo 1
2 bah 2
3 bee 3
desired result would look like this:
# A tibble: 3 x 3
name seqnbr my_list
<chr> <dbl> <chr>
1 boo 1 list(c(1:10) )
2 bah 2 list(c(2:10) )
3 bee 3 list(c(3:10) )
After this step, I would unnest() to make values explicit.
Tidyverse/purr solutions preferred.