[R] select elements in a list

arnaud Gaboury arnaud.gaboury at gmail.com
Fri May 21 11:07:02 CEST 2010


Dear group,

Here is a list :

l <-
list("100415", "100416", "100419", "100420", "100421", "100422", 
    "100423", "100426", "100427", "100428", "100429", "100430", 
    "100503", "100504", "100505", "100506", "100507", "100510", 
    "100511", "100512", "100513")

I need to access part of it with two variables, x and y. For example, if
x<-100415 et y<-100420, the result I want is 100415,100416,100419,100420.
The object "l" is a list, but can be of any other kind if it can help. 

I tried something like this :
>select<-l[c(x:y)]

But it doesn't return the needed result

Any help would be appreciated

***************************
Arnaud Gaboury
Mobile: +41 79 392 79 56
BBM: 255B488F



More information about the R-help mailing list