From Roger.bivand at nhh.no  Wed Aug 31 12:35:24 2011
From: Roger.bivand at nhh.no (Roger Bivand)
Date: Wed, 31 Aug 2011 10:35:24 +0000
Subject: [Rd] Problem exporting table with many columns to dbf
References: <CAGYV1bJCqzF9r4H9Qqv3-SS6zCr-88hW+pKJEzrre9gOKLYVmg@mail.gmail.com>
Message-ID: <loom.20110831T122609-237@post.gmane.org>

Nacho Uve <nachouve <at> gmail.com> writes:

> 
> Hello,
> 
> I'm newbie in R and I have a problem exporting a table with many columns to
> a dbf file.

In many sources, the maximum number of fields is said to be 128 or 255. I have
seen a reference to 1024. It varies a great deal with the software being used.
DBF is certainly not a good choice for writing objects with many columns. The
page refered to on ?write.dbf:

http://www.clicketyclick.dk/databases/xbase/format/dbf.html#DBF_STRUCT

gives 128 fields; on googling for "DBF maximum number of fields", I see that:

http://www.rhinocerus.net/forum/lang-clipper/193953-maximum-fields-per-record-dbf.html

gets to 1023/4, but there are reports of very varying behaviour across different
applications. Anything over 128 may be tempting fate.

> I found an error when I open the result DBF file on other software and also
> importing it on R again.
> 
> Here a example snippet of the problem (on a GNU/Linux OS):
> http://pastebin.com/0SMJqqwb
> 
> Is it a bug?

No, more an infelicity of a legacy format with unspecified extensions.

Hope this clarifies,

Roger

> 
> Thank you,
> Nacho V



[Rd] Problem exporting table with many columns to dbf
Roger Bivand