[R] Strange Bug in R

Pascal Oettli kridox at ymail.com
Tue Oct 6 11:18:35 CEST 2015


Hello,

1) Please don't put rm(list=ls()) in a script you submit to this list.
This is considered as bad manner.

2) Please read https://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f
and http://stackoverflow.com/a/9508558/3710546

Regards,
Pascal

On Tue, Oct 6, 2015 at 4:24 PM, Neverstop <neverstop at hotmail.it> wrote:
> Hi all.
> I don't understand why R works this way:
>> rm(list=ls())
>> require(foreign)
>> dataset <- read.dta("http://www.ats.ucla.edu/stat/data/ologit.dta")
>> min(dataset$gpa)
> [1] 1.9
>> min(dataset$gpa)>=1.90
> [1] FALSE
>> min(dataset$gpa)>=1.9
> [1] FALSE
>> min(dataset$gpa)>1.89
> [1] TRUE
> Shouldn't I get 3 TRUEs?
> Am I missing something?
> Thank you.
>
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Strange-Bug-in-R-tp4713175.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan



More information about the R-help mailing list