Re: [R] Select fixed number of elements

2013-10-30 Thread Alaios
Thumbs up! It worked! On Wednesday, October 30, 2013 9:41 AM, Gerrit Eichner wrote: Hello, Alaois, if x is your vector maybe n <- length( x) positions <- trunc( quantile( seq( n), prob = 0:5/5)) x[ positions] comes close to what you want.   Hth  --  Gerrit > Hi all, I have in my code

Re: [R] Select fixed number of elements

2013-10-30 Thread Ken Knoblauch
Alaios yahoo.com> writes: > I have in my code some vectors that are not of equal size. I would like to be able for each of these vectors > select 6 elements that are (almost) equally spaced. So the first one would be at (or close) to the beginning > the last one at (or close) to the end and the

Re: [R] Select fixed number of elements

2013-10-30 Thread Gerrit Eichner
Hello, Alaois, if x is your vector maybe n <- length( x) positions <- trunc( quantile( seq( n), prob = 0:5/5)) x[ positions] comes close to what you want. Hth -- Gerrit Hi all, I have in my code some vectors that are not of equal size. I would like to be able for each of these vectors sel