Skip to content
Prev 163868 / 398506 Next

systematically matching the numbers in two sequences

I am having trouble writing a code for matching two pairs of sequences with
differing lengths:

for example sequence1= 1,2,3,4,5,6,7 sequence2=1,2,3,4,5,6,7,8,9,10

I want to create several new pairs of sequences in several dataframes such
that:
1st dataframe is 1,10 (start of sequence1, end of sequence 2)
2nd dataframe is 1, 9
                         2, 10

3rd dataframe is 1, 8
                        2, 9
                        3, 10

etc etc.

I realise this may involve a complicated loop and am really struggling to
make a start on it.