Re: [Rd] as.data.frame.matrix() returns an invalid object

2012-10-13 Thread peter dalgaard
On Oct 11, 2012, at 16:02 , Bert Gunter wrote: > ... and further > >> identical(as.list(df2),as.list(df1)) > [1] TRUE > > in R 2.15.0 > > Not sure whether these sorts of degenerate cases are of much value, > though. But I'll leave that for the wizards. Looks like this is easier to fix that to

Re: [Rd] as.data.frame.matrix() returns an invalid object

2012-10-12 Thread Bert Gunter
... and further > identical(as.list(df2),as.list(df1)) [1] TRUE in R 2.15.0 Not sure whether these sorts of degenerate cases are of much value, though. But I'll leave that for the wizards. -- Bert On Wed, Oct 10, 2012 at 11:22 PM, Hervé Pagès wrote: > Hi, > > Two ways to create what should no

[Rd] as.data.frame.matrix() returns an invalid object

2012-10-10 Thread Hervé Pagès
Hi, Two ways to create what should normally be the same data frame: > df1 <- data.frame(a=character(0), b=character(0))> df1 [1] a b <0 rows> (or 0-length row.names) > df2 <- as.data.frame(matrix(character(0), ncol=2, dimnames=list(NULL, letters[1:2]))) > df2 [1] a b <0 rows> (o