Re: [R] select elements in a list

2010-05-21 Thread arnaud Gaboury
> Subject: Re: [R] select elements in a list > > Hi, > > This should work: > select <- l[which(l==x):which(l==y)] > > The problem is that you tried to select the values, but gave x and y as > indexes. That's why you didn't get the expected result. > >

Re: [R] select elements in a list

2010-05-21 Thread Ivan Calandra
Hi, This should work: select <- l[which(l==x):which(l==y)] The problem is that you tried to select the values, but gave x and y as indexes. That's why you didn't get the expected result. See ?which for more info. HTH, Ivan Le 5/21/2010 11:07, arnaud Gaboury a écrit : Dear group, Here is a

[R] select elements in a list

2010-05-21 Thread arnaud Gaboury
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