I've got a dataset that looks like this:
col1 | col2
a | b c d
e | f g h i j
I know the permutations function from gtool :
p <- (permutations(n=4,r=2,v=df),repeats.allowed=FALSE)
can extract the different permutations with or without repetition, but I need column 1 to stay in place, so that the expected outcome would be:
a b
a c
a d
e f
e g
e h
e i
e j
The documentation doesn't specify how to accomplish something like this. The second vector is variable length and I'll be using str_extract_all to pull them out.
Has anyone seen a way to accomplish the above? The intended outcome is an edge file to be used for network graphing.