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.