I ask for some help to solve the following issue. I have a dataset composed as
from to
A B
A B
C D
C D
I want to get the following dataset
from to
A B
A C
C A
C D
Basically, after group_by(from), I want a "cross-copying" between the value in the "to" column, between the last value of the "from" column in the first group and the first value of the "from" column in the second group, and so on for each group. I am using "complete" but it is not helpful.
to
column should be created. Maybe a longer example could be more helpful. – Piecework