Description Usage Arguments Value See Also Examples
Insert rows into a table (e.g. attribute table of a layer) with the arcpy.da module.
1 | da_insert(table.path, d, fmt)
|
table.path |
The file path to the table. |
d |
The data to write to |
fmt |
Vector of formats for the columns in |
The path to the table, i.e. table.path
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## Not run:
# create an empty table
library(arcpyr)
connect_ArcPython()
arcpy = arcpy_env(NULL, NULL)
attach_toolbox(arcpy, "management")
folder = "path/to/folder"
name = "table name"
arcpy$management$CreateTable(folder, name)
# create fields in new table
arcpy$management$AddField(file.path(folder, name), "ID", "SHORT")
arcpy$management$AddField(file.path(folder, name), "VALUE", "FLOAT")
arcpy$CreateTable_management(outpath, tablename)
# generate table contents in R
d = data.frame(ID = seq(10), VALUE = rnorm(10))
# write data to table
da_insert(file.path(folder, name), d)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.