From maechler@stat.math.ethz.ch  Thu Aug 22 10:47:22 2002
From: maechler@stat.math.ethz.ch (maechler@stat.math.ethz.ch)
Date: Thu, 22 Aug 2002 11:47:22 +0200 (MET DST)
Subject: as.list() coerces logical to integer (PR#1926)
Message-ID: <200208220947.LAA12226@pubhealth.ku.dk>

A symptom was seen by Ole Christensen when using sapply(*, is.numeric).

It can be simplified  to
``lapply coerces logical to integer'' :

  > lapply(TRUE, typeof)
  [[1]]
  [1] "integer"

But the bug is not in lapply's C code, but rather before that, 
namely in as.list() :

> typeof(as.list(TRUE)[[1]])
[1] "integer"

I'm looking into fixing this (for R-devel aka "1.6.0 unstable")
right away.

Martin

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


as.list() coerces logical to integer (PR#1926)
maechler@stat.math.ethz.ch