Skip to content
Prev 44237 / 63424 Next

as.data.frame.matrix() returns an invalid object

On Oct 11, 2012, at 16:02 , Bert Gunter wrote:

            
Looks like this is easier to fix that to argue pro/con fixing it...

AFAICS, there's a gap in the logic in as.data.frame.matrix:

    if (length(row.names) != nrows) 
        row.names <- .set_row_names(nrows)

but length(NULL) is 0 so we can end up leaving row.names at NULL and eventually nulling it in the result. An explicit check for is.null(row.names) should help.

-pd