From xie at yihui.name  Fri Jan 24 08:59:22 2014
From: xie at yihui.name (Yihui Xie)
Date: Fri, 24 Jan 2014 01:59:22 -0600
Subject: [Rd] Format an empty data frame
Message-ID: <CANROs4eqJQDbHYfYRZQ_xhyXTgVygufkEy_toWM8c+4iifcXXQ@mail.gmail.com>

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



[Rd] Format an empty data frame
Yihui Xie