Skip to content

how to construct an empty data.frame

3 messages · Omar Lakkis, Gabor Grothendieck, Brian Ripley

#
[1] open   settle
<0 rows> (or 0-length row.names)
[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.
#
On Thu, 28 Apr 2005, Omar Lakkis wrote:

            
Is this what you want?
[1] a b
<0 rows> (or 0-length row.names)
[1] "a" "b"