You can access the data slot of a shapefile s by:

d <- s@data

d is data frame, where you can a column and write it back to the shapefile.

s@data <- d

Hope this helps
Johannes

On Mon, Mar 21, 2011 at 7:29 PM, Advait Godbole <advaitgodbole@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@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]

