Re: [R] match() & seq()

From: Dimitris Rizopoulos <dimitris.rizopoulos_at_med.kuleuven.be>
Date: Tue 31 Jan 2006 - 01:35:44 EST

the problem is in

0.3 == seq(0.1,1,by=0.1)[3]

versus

all.equal(0.3, seq(0.1,1,by=0.1)[3])

look at ?Comparison for more info.

I hope it helps.

Best,
Dimitris



Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium

Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://www.med.kuleuven.be/biostat/
     http://www.student.kuleuven.be/~m0390867/dimitris.htm


> sorry if it has already been discussed but i can't understand this:
>
> > seq(0.1,1,by=0.1)
> [1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
> > match(0.1,seq(0.1,1,by=0.1))
> [1] 1
> > match(0.2,seq(0.1,1,by=0.1))
> [1] 2
> > match(0.3,seq(0.1,1,by=0.1))
> [1] NA
> > match(0.4,seq(0.1,1,by=0.1))
> [1] 4
>
> > R.version
> _
> platform i386-pc-mingw32
> arch i386
> os mingw32
> system i386, mingw32
> status
> major 2
> minor 2.1
> year 2005
> month 12
> day 20
> svn rev 36812
> language R
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
>
https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Jan 31 01:54:28 2006

This archive was generated by hypermail 2.1.8 : Tue 31 Jan 2006 - 08:21:49 EST