From ripley at stats.ox.ac.uk  Sat Oct 11 21:24:02 2008
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Sat, 11 Oct 2008 20:24:02 +0100 (BST)
Subject: [Rd] match() (PR#13135)
In-Reply-To: <20081006220506.C888B282EF48@mail.pubhealth.ku.dk>
References: <20081006220506.C888B282EF48@mail.pubhealth.ku.dk>
Message-ID: <alpine.LFD.2.00.0810112022330.8667@gannet.stats.ox.ac.uk>

FAQ Q7.31 strikes again!

0.89 is not a member of seq(0.6,1,by=0.01), since 0.01 cannot be 
represented exactly in a binary computer.

On Tue, 7 Oct 2008, wchen at stat.tamu.edu wrote:

> Full_Name: Willa Chen
> Version: 2.7.2
> OS: Window XP
> Submission from: (NULL) (128.122.182.70)
>
>
>
>
> The match function does not return value properly. See an example below.
>
>
>> a<-seq(0.6,1,by=0.01)
>> match(0.88,a)
> [1] 29
>> match(0.89,a)
> [1] NA
>> match(0.90,a)
> [1] NA
>> match(0.91,a)
> [1] NA
>> match(0.92,a)
> [1] NA
>> match(0.93,a)
> [1] NA
>> match(0.94,a)
> [1] 35
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] match() (PR#13135)
Prof Brian Ripley