[Rd] rbind.data.frame changes

From: <Mark.Bravington_at_csiro.au>
Date: Thu, 28 Jun 2007 09:27:22 +1000

Dear R-devel

Pre-2.5.0, 'rbind.data.frame(x,y,...)' would set the class of each column to be the class of that column in 'x'. This has changed now, because 'rbind.data.frame' first deletes any zero-row arguments; so if 'x' is a zero-row DF, the classes will be set to those in 'y'.

This breaks my code in a number of places, where I've created 0*N data.frames with the correct column classes, and then subsequently added rows, typically via 'rbind( my.df, list( col1=...))'. Typically the issue is with unwanted conversion of characters into factors, and I've set up the zero-row DF specifically to avoid that.

My understanding of the motivation for the change is that there were problems with 0*0 data.frames only. But 0*(N>0) data.frames where N>0 were handled OK, I think. It therefore seems to me that the new behaviour is undesirable for 0*(N>0), in that they are treated differently to (M>0)*(N>0) data.frames for no very compelling reason.

Before I go through all the code in 'mvbutils' and 'debug' to work round this, I wanted to make sure that the change really is intentional and "permanent". Can anyone confirm/deny this?


Mark Bravington
CSIRO Mathematical & Information Sciences Marine Laboratory
Castray Esplanade
Hobart 7001
TAS ph (+61) 3 6232 5118
fax (+61) 3 6232 5012
mob (+61) 438 315 623

R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed 27 Jun 2007 - 23:29:39 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 28 Jun 2007 - 05:36:00 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.