[R] How do you generate multiple sequences

Mulholland, Tom Tom.Mulholland at dpi.wa.gov.au
Thu Dec 23 08:46:17 CET 2004


I thought it would be quite simple to generate a number of sequences, but my only answer is to loop and this doesn't seem in keeping with R's capabilities.

In short I have the start and finish positions of several (well thousands probably) sequences. So I am looking at how do I take

x <- c(2,6,13,20)
y <- c(4,10,16,24)

 and produce a list with four components with the appropriate sequence

Something like
[[1]]
[1] 2 3 4

[[2]]
 [1] 6 7 8 9 10

[[3]]
 [1] 13 14 15 16

[[4]]
 [1] 20 21 22 23 24

So can someone point me in the direction of the ******* obvious



Tom Mulholland
         _              
platform i386-pc-mingw32
arch     i386           
os       mingw32        
system   i386, mingw32  
status                  
major    2              
minor    0.0            
year     2004           
month    10             
day      04             
language R




More information about the R-help mailing list