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

From: <lawremi_at_iastate.edu>
Date: Sat, 05 May 2007 14:01:03 +0200 (CEST)

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 rows.

--please do not edit the information below-- Version:
 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

R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat 05 May 2007 - 13:08:06 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 Sun 06 May 2007 - 18:33:53 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.