Read a table (e.g. attribute table of a layer) with the
arcpy.da
module.
da_read(table.path, fields, simplify = TRUE)
a dataframe with columns corresponding to fields
.
This implementation may be faster than accessing the
@data
slot of an object created from rgdal::readOGR
in cases where there are a very large number of features. An
additional advantage of da_read
is that it can read
raster attribute tables and stand-alone tables stored in file
geodatabases, which is not supported by rgdal::readOGR
.
if (FALSE) { # \dontrun{
arcpy$env$workspace = tempdir()
arcpy$env$scratchWorkspace = tempdir()
fc = arcpy$management$CopyFeatures(system.file("CA_Counties",
"CA_Counties_TIGER2016.shp", package = "arcpy"), "CA_Counties")
da_read(fc, c("COUNTYFP", "ALAND"))
} # }