da_update: Update Table with arcpy.da

Description Usage Arguments Value See Also Examples

View source: R/utils.r

Description

Update a table (e.g. attribute table of a layer) with the arcpy.da module.

Usage

1
da_update(table.path, d, fmt)

Arguments

table.path

The file path to the table.

d

The data to write to table.path, with the same number of rows as the table. Column names must match field names of the table.

fmt

Vector of formats for the columns in d. If missing, the format will be automatically detected as numeric (%f), integer (%d), or string (%s). See sprintf for more information on format strings.

Value

The path to the table, i.e. table.path.

See Also

sprintf

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
layer = "path/to/table"
fields = c("VALUE", "NOTE")
field.formats = c("%f", "%s")
d = da_read(layer, fields)
d["VALUE"] = d$VALUE + 5
d["NOTE"] = "modified"
da_update(layer, d, field.formats)

## End(Not run)

mkoohafkan/arcpyrextra documentation built on May 23, 2019, 2:02 a.m.