Dear R-Core, after switching to 2.3.0, all my trusted do.call constructs that worked in 2.2 and earlier fail. I noted that changes were introduced to do.call, but I could not find out how these relate to my problem. The following example works in 2.2 and earlier, but fails because rownames are partially NA. I can correct this by manually adding row names, but it's a bit of work to check this in all my code. Dieter ------ wby = by(warpbreaks[, 1:2], warpbreaks$tension, function(x) { data.frame(breaks=mean(x$breaks),var=var(x$breaks)) } ) cd = do.call("rbind",wby) row.names(cd) cd ---- Output in 2.3.0> row.names(cd)[1] NA "NA1" "NA2"> cdError in data.frame(breaks = c("36.38889", "26.38889", "21.66667"), var c("270.48693", : row names contain missing values>---- platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 2 minor 3.0 year 2006 month 04 day 24 svn rev 37909 language R version.string Version 2.3.0 (2006-04-24)
See: https://www.stat.math.ethz.ch/pipermail/r-devel/2006-May/037542.html On 5/4/06, Dieter Menne <dieter.menne at menne-biomed.de> wrote:> Dear R-Core, > > after switching to 2.3.0, all my trusted do.call constructs that worked in > 2.2 and earlier fail. I noted that changes were introduced to do.call, but I > could not find out how these relate to my problem. > > The following example works in 2.2 and earlier, but fails because rownames > are partially NA. I can correct this by manually adding row names, but it's > a bit of work to check this in all my code. > > Dieter > > ------ > > wby = by(warpbreaks[, 1:2], warpbreaks$tension, > function(x) { > data.frame(breaks=mean(x$breaks),var=var(x$breaks)) > } > ) > > cd = do.call("rbind",wby) > row.names(cd) > cd > > ---- Output in 2.3.0 > > row.names(cd) > [1] NA "NA1" "NA2" > > cd > Error in data.frame(breaks = c("36.38889", "26.38889", "21.66667"), var > c("270.48693", : > row names contain missing values > > > > ---- > platform i386-pc-mingw32 > arch i386 > os mingw32 > system i386, mingw32 > status > major 2 > minor 3.0 > year 2006 > month 04 > day 24 > svn rev 37909 > language R > version.string Version 2.3.0 (2006-04-24) > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >
This is nothing to do with do.call, but with rbind.data.frame. It is already fixed in R-patched: o rbind()ing dataframes with a single row could lead to a corrupt data frame (a problem with the fix to PR#8506). (and the example works in R-patched and R-devel). The strange thing is that three people have now reported this after release, but no alpha- or beta- tester did. Please can people help with the pre-release testing, not report post-release? On Thu, 4 May 2006, Dieter Menne wrote:> Dear R-Core, > > after switching to 2.3.0, all my trusted do.call constructs that worked in > 2.2 and earlier fail. I noted that changes were introduced to do.call, but I > could not find out how these relate to my problem. > > The following example works in 2.2 and earlier, but fails because rownames > are partially NA. I can correct this by manually adding row names, but it's > a bit of work to check this in all my code. > > Dieter > > ------ > > wby = by(warpbreaks[, 1:2], warpbreaks$tension, > function(x) { > data.frame(breaks=mean(x$breaks),var=var(x$breaks)) > } > ) > > cd = do.call("rbind",wby) > row.names(cd) > cd > > ---- Output in 2.3.0 >> row.names(cd) > [1] NA "NA1" "NA2" >> cd > Error in data.frame(breaks = c("36.38889", "26.38889", "21.66667"), var > c("270.48693", : > row names contain missing values >> > > ---- > platform i386-pc-mingw32 > arch i386 > os mingw32 > system i386, mingw32 > status > major 2 > minor 3.0 > year 2006 > month 04 > day 24 > svn rev 37909 > language R > version.string Version 2.3.0 (2006-04-24) > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595