You can't replace them, indeed. But you can do: Spatial = as(Spatial, "data.frame") coordinates(Spatial) = ~ newx + newy
On 11/27/2011 10:07 PM, Jonathan Greenberg wrote: > R-sig-geo'ers: > > I assume this is probably something really obvious I'm missing, but how do > I replace existing coordinates of a Spatial* object with new ones? > coordinates(myspatial) = ~newx+newy is giving me an error like: > >> class(Spatial) > > [1] "SpatialPointsDataFrame" > > attr(,"package") > > [1] "sp" > >> coordinates(Spatial)=~(mean(new_bbox[1,]))+(mean(new_bbox[2,])) > > Error in `coordinates<-`(`*tmp*`, value = ~(mean(new_bbox[1, ])) + > (mean(new_bbox[2, : > > setting coordinates cannot be done on Spatial objects, where they have > already been set > > > --j > > -- Edzer Pebesma Institute for Geoinformatics (ifgi), University of Münster Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251 8333081, Fax: +49 251 8339763 http://ifgi.uni-muenster.de http://www.52north.org/geostatistics [email protected] _______________________________________________ R-sig-Geo mailing list [email protected] https://stat.ethz.ch/mailman/listinfo/r-sig-geo
