Bug 17238 - Incorrert NULL Handling in Write.DBF
Summary: Incorrert NULL Handling in Write.DBF
Alias: None
Product: R
Classification: Unclassified
Component: Add-ons (show other bugs)
Version: R 3.3.*
Hardware: All All
: P5 enhancement
Assignee: R-core
Depends on:
Reported: 2017-03-17 14:56 UTC by Marcelo Simas
Modified: 2017-04-18 16:00 UTC (History)
0 users

See Also:

Patch file for updating NULL value used in DBF files (foreign package) (753 bytes, patch)
2017-03-17 14:56 UTC, Marcelo Simas
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marcelo Simas 2017-03-17 14:56:22 UTC
Created attachment 2238 [details]
Patch file for updating NULL value used in DBF files (foreign package)

We were trying to use R to automate the generation of deliverable DBF files as part of a transportation project for Michigan DOT and Detroit's MPO (SEMCOG) and realized that the resulting files did not handle NA in a manner that was consistent with what is expected by GIS software tools from ESRI (ArcGIS) and Caliper (TransCAD).  

To address this problem we obtained a sample DBF file generated using TransCAD and plugged in the byte used to signify NULL fields into the dbfopen.c source file in the foreign package.  Once the package was re-compiled and used to generate new DBF files we obtained confirmation from the clients that NULL values were being correctly displayed in TransCAD.  We believe that this update will also improve the accuracy of DBF extracts and would like to see if incorporated into future versions of the foreign package.

We have attached a patch file for this change.
Comment 1 Marcelo Simas 2017-04-18 16:00:32 UTC