Skip to content

row.names(data.frame(matrixWithDimnames)) depends on first rowname being "" or not. (PR#13230)

1 message · Brian Ripley

#
On Thu, 30 Oct 2008, wdunlap at tibco.com wrote:

            
Well, there is a comment in the sources,

 	if(missing(row.names) && nrows[i] > 0L) {
             rowsi <- attr(xi, "row.names")
             ## old way to mark optional names
             if(!(rowsi[[1L]] %in% ""))
                 row.names <- data.row.names(row.names, rowsi, i)
         }

which was last changed in Dec 2006.  However, the behaviour was much 
older.

It seems we can now change it to just test for some non-empty row name.