Re: [R] strange behaviour when subsetting a data.frame

2013-11-07 Thread Simon Hayward
R] strange behaviour when subsetting a data.frame Yes, but notice that man2[3,] == .3 [1] FALSE This is because of issues of machine precision when dealing with floating points, not a problem in R. Comparisons for nearly equivalent numbers are done using all.equal() as shown below. > all.equal

Re: [R] strange behaviour when subsetting a data.frame

2013-11-07 Thread Doran, Harold
-- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Doran, Harold Sent: 07 November 2013 16:52 To: 'Eckstädt, Elisabeth'; r-help@R-project.org Subject: Re: [R] strange behaviour when subsetting a data.frame Yes, but notice that man2[3,] == .3 [1] FALSE

Re: [R] strange behaviour when subsetting a data.frame

2013-11-07 Thread Doran, Harold
Yes, but notice that man2[3,] == .3 [1] FALSE This is because of issues of machine precision when dealing with floating points, not a problem in R. Comparisons for nearly equivalent numbers are done using all.equal() as shown below. > all.equal(man2[3,], .3) [1] TRUE -Original Message

Re: [R] strange behaviour when subsetting a data.frame

2013-11-07 Thread Sarah Goslee
R FAQ 7.31. http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f On Thu, Nov 7, 2013 at 8:36 AM, Eckstädt, Elisabeth wrote: > Hello everyone, > I am experiencing a unfathomable benaviour of "subset" on a data.frame. This > is a minimal reproducable e