From ripley at stats.ox.ac.uk  Wed May 23 19:29:27 2007
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Wed, 23 May 2007 18:29:27 +0100 (BST)
Subject: [Rd] is.finite confusion
In-Reply-To: <200705231318.37662.vdergachev@rcgardis.com>
References: <200705231318.37662.vdergachev@rcgardis.com>
Message-ID: <Pine.LNX.4.64.0705231825400.960@gannet.stats.ox.ac.uk>

No, because it is carefully documented to do this, and people rely on it 
working as documented.  (Did you do the homework the posting guide asked 
for?)  What harm came out of learning that the values were not finite?

On Wed, 23 May 2007, Vladimir Dergachev wrote:

>
>    I have recently made a silly screwup by applying is.finite() to a
> character vector:
>
>>  is.finite(c("a", "b"))
> [1] FALSE FALSE
>
> This does work with factors of course (as they are integer underneath)
>
> I wonder if a fix could be put in so that it either reports an error when
> applied to a character vector - or, perhaps better, act as is.na()

What way is that?  It acts in the same way, as I understand the help 
pages.

>
>                      thank you
>
>                               Vladimir Dergachev
> PS test on R 2.5.0, 2.3.1

-- 
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] is.finite confusion
Prof Brian Ripley