[Rd] rbind fails with zero row data.frame and non-data.frame (PR#9657)

lawremi at iastate.edu lawremi at iastate.edu
Sat May 5 14:01:03 CEST 2007

Full_Name: Michael Lawrence
Version: 2.5.0
OS: Linux
Submission from: (NULL) (

With R 2.5.0, when trying to rbind a zero row data.frame to a 
non-data.frame (eg character vector), the following error is output:
Error in all.levs[[j]] : subscript out of bounds

Here is the code to reproduce the error:
rbind(data.frame(foo=character(0), bar=character(0)), c(foo="foo", bar="bar"))

It seems that the code assumes that it has at least one data.frame but 
the data.frame was filtered out at the beginning, because it had zero 

--please do not edit the information below--
 platform = i686-pc-linux-gnu
 arch = i686
 os = linux-gnu
 system = i686, linux-gnu
 status = 
 major = 2
 minor = 5.0
 year = 2007
 month = 04
 day = 23
 svn rev = 41293
 language = R
 version.string = R version 2.5.0 (2007-04-23)


Search Path:
 .GlobalEnv, package:stats, package:graphics, package:grDevices, package:utils,
package:datasets, package:methods, Autoloads, package:base

More information about the R-devel mailing list