I have the following source vector:
source_vec <- c(1:3)
What I want to do is to enumerate the vector by splitting into two when one value is selected the other vector is complementary. Finally, it'll look like this (do by hand):
from to
1,2 3
1,3 2
2,3 1
Note that the to
column only one value, but from can be many.
Ideally, the final output is a dataframe/tibble, but from
column is a list column.
How can I achieve that with R?