[Rd] foreign::read.dbf fails to parse dbf properly

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Sat Jul 30 14:17:25 CEST 2022


On 29/07/2022 4:52 p.m., Ezra Tucker wrote:
> Dear R developers,
> 
> tl;dr I've been trying to read foxpro dbf files with
> foreign::read.dbf(), they weren't being read properly, I patched the
> foreign package to make it work, now what?
> 
> Long version:
> I recently encountered unexpected behavior attempting to read dbf files
> using foreign::read.dbf() from here:
> 
> https://forms.ferc.gov/f1allyears/f1_2020.zip
> 
> unzipped, in UPLOADERS/FORM1/working/F1_15.DBF - and as a note, this is
> a foxpro database. I would expect the first row of the first column to
> be 40, instead I am getting "(" (realizing that "(" has a decimal ascii
> value of 40). The xbase docs indicate that this is a field of type "I"
> which is a 4-byte integer unique to foxpro, and it doesn't look like
> this case is contemplated by read.dbf()
> 
> I made some modifications to Rdbfread.c and dbfopen.c in the foreign
> package (version 0.8-82) to add specific handling for field type "I".
> 
> I'm not current set up to contribute directly, I don't have SVN access.
> 
> 1. Is this patch of general interest? I'm weighing in the development
> guidelines:
>    - DO NOT fix exotic bugs that haven't bugged anyone
>    - DO make small enhancements if they are badly needed
> and I feel like this is maybe a bit of an exotic lack-of-feature
> (wouldn't call it a bug), and I have no idea if this is badly needed
> (by anybody, other than myself)
> 
> 2. if of general interest, how can I get set up with SVN credentials
> for R-packages?

Roger addressed your first question.  I'll give some information about 
the second one.

You should automatically have read permission on the R-packages 
repository, as with most R svn repositories.

I think to get write permission, you'd need to be invited to join R 
Core, or to be a maintainer of the package.

The more common way to have changes accepted is to post them to the 
bugs.r-project.org web site.  See https://www.r-project.org/bugs.html 
for more details on how to get an account set up there so you can post 
things.

Duncan Murdoch



More information about the R-devel mailing list