Re: [R] Strange subvector output -- x[n] != x[1:n][n]

2013-12-20 Thread Patrick Burns
You've found an interesting corner of Circle 1 of 'The R Inferno'. http://www.burns-stat.com/documents/books/the-r-inferno/ The issue is that your 'n' in the final case is slightly less than 11. So: n [1] 11 as.integer(n) [1] 10 1:n [1] 1 2 3 4 5 6 7 8 9 10 11 The mystery to me

[R] Strange subvector output -- x[n] != x[1:n][n]

2013-12-19 Thread Gewart
Hi, Can anyone explain what is going on...!? For a vector x=seq(min,max,0.01), when generating sub-vector a based on a starting value st, things go as expected as long as st is not too close to the beginning of x. For example, if x starts at -5 and increments by 0.01, whenever I try to generate

Re: [R] Strange subvector output -- x[n] != x[1:n][n]

2013-12-19 Thread Jeff Newmiller
Sigh. Google couldn't help you? Try FAQ 7.31 and then use non-fractions to generate sequences... scale as desired. This is not unique to R. --- Jeff NewmillerThe . . Go Live...