[R] systematically matching the numbers in two sequences

2008-12-05 Thread emj83
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

Re: [R] systematically matching the numbers in two sequences

2008-12-05 Thread Henrique Dallazuanna
Try this: s1 - 1:7 s2 - 1:10 lapply(seq(length(s1)), function(i)cbind(head(s1, i), tail(s2, i))) On Fri, Dec 5, 2008 at 1:44 PM, emj83 [EMAIL PROTECTED] wrote: I am having trouble writing a code for matching two pairs of sequences with differing lengths: for example sequence1=

[R] systematically matching the numbers in two sequences

2008-12-05 Thread emj83
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