I have this data.table and I would like to generate all possible 'prefixes' in the chain.

```
user_id         v_chain                  nr_v       root_v_chain           last_v
616905      3 -> 8 -> 16 -> 17 -> 25        5     3 -> 8 -> 16 -> 17        25

```

This should become

```
user_id         v_chain                  nr_v       root_v_chain           last_v
616905      3 -> 8                          5     3 -> 8 -> 16 -> 17        25
616905      3 -> 8 -> 16                    5     3 -> 8 -> 16 -> 17        25
616905      3 -> 8 -> 16 -> 17              5     3 -> 8 -> 16 -> 17        25
616905      3 -> 8 -> 16 -> 17 -> 25        5     3 -> 8 -> 16 -> 17        25

```

How do I iterate over the whole chain and generate new rows?

Data

```
dd <- read.table(stringsAsFactors = FALSE, header = TRUE,
text = "user_id         v_chain                  nr_v       root_v_chain           last_v
616905      '3 -> 8 -> 16 -> 17 -> 25'        5     '3 -> 8 -> 16 -> 17'        25")

```