I am getting an "unknown structure error" when using arc.write from the latest arcgisbindings pkg. I tried to follow the example in the package vignette for arc.write. I am guessing it is not using the correct coords or shape_info like it should...Any idea how should I fix this? Here are my steps:
1) Reading a polygon shp,
2) Extracting its data.frame,
3) Joining it with an existing R data.frame (by a common attribute name)
4) Saving it back to a new shp
...
fc <- arc.open(<input_shapefile>)
fc.df <- arc.select(fc)
fc.df_join <- left_join(fc.df, <existing_dataframe>, by = 'ISO_3_CODE')
dim(fc.df_join)
[1] 211 11
arc.write(path="./output.shp", data=fc.df_join,
coords = arc.shapeinfo(fc)$WKT,
shape_info = arc.shapeinfo(fc))
Error in .call_proxy("arc_export2dataset", path, data, coords, shape_info) :
unknown structure
In addition: Warning message:
In .call_proxy("arc_export2dataset", path, data, coords, shape_info) :
length of shape != data.frame length