From p.dalgaard at biostat.ku.dk  Mon Dec  8 17:00:13 2003
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: Mon Dec  8 16:59:14 2003
Subject: [Rd] matrix coercion, logical -> character
Message-ID: <x2smjvpaeq.fsf@biostat.ku.dk>


Anyone know whether this is intentional, and by which rationale?
(R-devel on RedHat, but hardly new)


> l <- data.frame(a=rpois(10,1)>0,b=rpois(10,1)>0)
> apply(l,1,which)
Error in FUN(newX[, i], ...) : argument to "which" is not logical
> lapply(l,mode)
$a
[1] "logical"

$b
[1] "logical"

> mode(as.matrix(l))
[1] "character"


-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907


[Rd] matrix coercion, logical -> character
Peter Dalgaard