[R] how to construct an empty data.frame

Omar Lakkis uofiowa at gmail.com
Thu Apr 28 19:17:46 CEST 2005


> r
[1] open   settle
<0 rows> (or 0-length row.names)
> class(r)
[1] "data.frame"

this is an empty data.frame I get back from a sql statement that
returns an empty result set. How can I create such an empty data.frame
using the data.frame() constructor?
I want to have a data.frame with 0 rows but named empty columns.

Thanks in advance for any help.




More information about the R-help mailing list