Skip to content
Prev 11271 / 63468 Next

matrix coercion, logical -> character

It seems another reason to make the change would be the
ability to work around the following feature:

 > lmat <- as.matrix(data.frame(a=c(FALSE, TRUE)))
 > lmat
  a     
1 "FALSE"
2 " TRUE"
 > mode(lmat) <- "logical"
 >
 > lmat
      a
1 FALSE
2    NA

Numeric, character and logical were mentioned.  Complex data
frames coerce to complex matrices already.

Apropos of this, it would be good to put a See Also "complex"
in the "numeric" help file and vice versa.

Patrick Burns

Burns Statistics
patrick@burns-stat.com
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and "A Guide for the Unwilling S User")
Peter Dalgaard wrote: