adding variable to shapefile
you can even operate directly on the object you obtained from reading the shapefile. To add a column called test just do s$test <- test assuming that test has length(test)==nrow(s). In case you want it back in the shapefile use writePolyShape. Tom Am 21.03.2011 19:56, schrieb Johannes Signer:
You can access the data slot of a shapefile s by: d<- s at data d is data frame, where you can a column and write it back to the shapefile. s at data<- d Hope this helps Johannes On Mon, Mar 21, 2011 at 7:29 PM, Advait Godbole<advaitgodbole at gmail.com>wrote:
Dear R-users,
I am reading a shapefile in to R using readShapePoly, do some spatial
modeling on it and obtain a new variable which I want to write to the same
polygons as a new attribute (variable) preserving the spatial structure. Is
there a straightforward way of doing it via a "write-to-shapefile"
function?
Thanks in advance,
--
advait godbole
[[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
[[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Technische Universit?t M?nchen Department f?r Pflanzenwissenschaften Lehrstuhl f?r Gr?nlandlehre Alte Akademie 12 85350 Freising / Germany Phone: ++49 (0)8161 715324 Fax: ++49 (0)8161 713243 email: tom.gottfried at wzw.tum.de http://www.wzw.tum.de/gruenland