[Rd] Format an empty data frame

Yihui Xie xie at yihui.name
Fri Jan 24 08:59:22 CET 2014


Hi,

Here seems to be a corner case in which format() fails:

> format(data.frame())
Error in .subset2(x, i, exact = exact) : subscript out of bounds

> sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base


Regards,
Yihui
--
Yihui Xie <xieyihui at gmail.com>
Web: http://yihui.name



More information about the R-devel mailing list