[R] is.numeric()

Martin Maechler maechler at stat.math.ethz.ch
Thu Aug 22 11:38:21 CEST 2002


>>>>> "Ole" == Ole Christensen <o.christensen at lancaster.ac.uk>
>>>>>     on Thu, 22 Aug 2002 09:56:37 +0100 writes:

	  ...

    Ole> I still have a problem with vectorizing is.numeric() for a logical
    Ole> vector :

something which does never make sense, since 
for atomic vectors (i.e. non-lists), all elements are of identical type.
(as I think Thomas *did* say).

However, you really found a bug in lapply() {which is called by
sapply()} :

    Ole> gives:

    >> vec <- c(TRUE, FALSE, NA, NA)
    >> sapply(vec,FUN=is.numeric)
    Ole> [1] TRUE TRUE TRUE TRUE

{and the same from unlist(sapply(*))}
which is definitely wrong.

So, finally:  Thank you for the bug report!  
{I'll put it into R-bugs}

Martin Maechler <maechler at stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO C16	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list