Skip to content
Prev 274375 / 398506 Next

getting data associated with coordinates in a spatial data frame

On Thu, Oct 13, 2011 at 2:44 PM, Bailey, Daniel <bailed at spu.edu> wrote:
You assign it a new value, just as for any assignment. Using the
example from my previous email:
x      y part.a part.b dist soil ffreq
5 181100 333660      1      0    0    1     1
x      y part.a part.b dist soil ffreq
5 181100 333660      1      0    0    5     1
That's not what it's *for*. SGDFs are for storing and working with
spatial data, where all the components are needed for the spatial
reference. If you need to manipulate a lot of things, you're better
off doing it before you construct the SGDF, or you can cheat by
extracting the data slot, working with it, then reassigning it as a
single unit.

mydata <- m at data
# do stuff
m at data <- mydata

You might also benefit from reading "Applied Spatial Data Analysis
with R" by Bivand et al.

Sarah