Skip to content
Prev 11269 / 63468 Next

matrix coercion, logical -> character

On 8 Dec 2003, Peter Dalgaard wrote:

            
It is documented:

     'as.matrix' is a generic function. The method for data frames will
     convert any non-numeric column into a character vector using
     'format' and so return a character matrix.

Remember than not some long ago you could not have logical columns in data 
frames: they were coerced to factors.

It would be easy to change to allow numeric, logical or character 
matrices.