File geodatabase (fgdb) includes numerous file geodatabase tables. As far as I know they exist as dbf files, but are within a Database.gdb.

In ArcCatalog, the file pathway resembles C:\Users\...\Database.gdb\Stats_AA.

How to read all of these dbf files into R (a statistical software)? What is the correct pathway to supply? The function used is read.dbf (in the foreign package).

Variants of




don't work. What's the correct "form" of the file name to be used, or, do I need to export all of the file geodatabase tables into some other form or location?


3 Answers 3


File geodatabases don't store their data as a dbf, shapefiles do. FGDB's use their own internal storage method.

ESRI's published an API, if use it to compile GDAL with file geodatabase support you might be able to use R's gdal plugins to get access to your data that way. However, the easiest solution is probably converting your data to shapefile, then you can use R's dbf tools.

  • Or just export the attribute table as a dbf rather than converting the entire feature class.
    – Baltok
    Commented Feb 1, 2013 at 21:14
  • 1
    Oh that's true! You can also use the Xtools toolbar to export the attribute table directly to Excel. The free version of the toolbar includes the Excel export ability. xtoolspro.com Commented Feb 1, 2013 at 21:16
  • @HeyOverThere- thanks for pointing that out, you are correct- these tables are "File Geodatabase Tables" which explains why I couldn't find them as .dbf files. I'm going with Aaron's exporting approach, however, converting all of my data into shapefiles would be more time consuming.
    – Nan
    Commented Feb 2, 2013 at 22:25
  • The API link appears to be dead. Could you please update it?
    – Aaron
    Commented Jun 18, 2015 at 17:14
  • Looks like ESRI did some housecleaning. The link's updated to point to the new location Commented Jun 22, 2015 at 13:29

A simple solution is to use Table to dBase (multiple) to export your tables (Right click FGDB > Export > To dBase (multiple). You can also use this tool to export attribute tables contained within FGDB feature classes. Just drag and drop tables and or feature classes into the tool and specify an output folder. Of course, then you can loop through the folder containing the new dBase files using R.

enter image description here

enter image description here

  • This works- my dropdown menu doesn't look the same (I'm sorry, I don't fully understand ArcMap file systems) but I found I can export tables by right clicking on the table entry itself in the Table of Contents, and generate a readable .dbf file. Thanks!
    – Nan
    Commented Feb 2, 2013 at 22:19

I ran into the same problem. It is inconvenient to use ArcMap, in my opinion. Instead, I invoked python from R using the following code. It requires you to have Arcpy, unfortunately.

Python script:

import os,sys
import arcpy
from arcpy import env
from sys import argv ### This is needed to import variables

script, featureClass, inFeatures, outLocation, outFeatureClass = argv
env.workspace = featureClass ### set working directory
arcpy.FeatureClassToFeatureClass_conversion(inFeatures, outLocation,outFeatureClass)

R code:

script = "./Path To Python Script/Example.py"
featureClass = './Path To Geodatabase/Example.gdb'
inFeatures = "featureClass"
outLocation = "./Path To Outfile Location"
outFeatureClass = "test.shp"
system2('python', args = c(shQuote(script),shQuote(featureClass),shQuote(inFeatures),shQuote(outLocation),shQuote(outFeatureClass))) 

The above will output a shapefile from a geodatabase, then you will have to import into R.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.