Re: [R] getting data associated with coordinates in a spatial data frame

2011-10-14 Thread jon . skoien
On 13-Oct-11 20:33, Sarah Goslee wrote: Hi, On Thu, Oct 13, 2011 at 2:05 PM, Bailey, Daniel wrote: Thank you Sarah. I tried your suggestion, and if I coerce it into a normal data.frame, that method works. But if you've already made the data into a SpatialPixelsDataFrame and run coordinates (b

Re: [R] getting data associated with coordinates in a spatial data frame

2011-10-13 Thread Bailey, Daniel
Woohoo! Thank you Sarah and Michael. You are rock stars! Daniel -Original Message- From: Sarah Goslee [mailto:sarah.gos...@gmail.com] Sent: Thursday, October 13, 2011 11:54 AM To: Bailey, Daniel Cc: r-help@r-project.org Subject: Re: [R] getting data associated with coordinates in a

Re: [R] getting data associated with coordinates in a spatial data frame

2011-10-13 Thread Sarah Goslee
On Thu, Oct 13, 2011 at 2:44 PM, Bailey, Daniel wrote: > Michael, that's half of the problem solved (whew!!). Now how do I change the > data at that location? You assign it a new value, just as for any assignment. Using the example from my previous email: > data(meuse.grid) > m = SpatialPixels

Re: [R] getting data associated with coordinates in a spatial data frame

2011-10-13 Thread Bailey, Daniel
ailey, Daniel Cc: Sarah Goslee; r-help@r-project.org Subject: Re: [R] getting data associated with coordinates in a spatial data frame Ah yes, my eternal nemesis the S4 class... You were basically there with e[e$coordinates==(0,17),] but for some access stuff that comes from the SpatialDataPoints

Re: [R] getting data associated with coordinates in a spatial data frame

2011-10-13 Thread R. Michael Weylandt
Formal class 'CRS' [package "sp"] with 1 slots >  .. .. ..@ projargs: chr NA > > -Original Message- > From: R. Michael Weylandt [mailto:michael.weyla...@gmail.com] > Sent: Thursday, October 13, 2011 11:13 AM > To: Bailey, Daniel > Cc: Sarah Goslee; r-help@r

Re: [R] getting data associated with coordinates in a spatial data frame

2011-10-13 Thread Sarah Goslee
Hi, On Thu, Oct 13, 2011 at 2:05 PM, Bailey, Daniel wrote: > Thank you Sarah. I tried your suggestion, and if I coerce it into a normal > data.frame, that method works. But if you've already made the data into a > SpatialPixelsDataFrame and run coordinates (both from the package "sp") so > tha

Re: [R] getting data associated with coordinates in a spatial data frame

2011-10-13 Thread Weidong Gu
---Original Message- > From: R. Michael Weylandt [mailto:michael.weyla...@gmail.com] > Sent: Thursday, October 13, 2011 11:13 AM > To: Bailey, Daniel > Cc: Sarah Goslee; r-help@r-project.org > Subject: Re: [R] getting data associated with coordinates in a spatial dat

Re: [R] getting data associated with coordinates in a spatial data frame

2011-10-13 Thread Bailey, Daniel
quot;] with 1 slots .. .. ..@ projargs: chr NA -Original Message- From: R. Michael Weylandt [mailto:michael.weyla...@gmail.com] Sent: Thursday, October 13, 2011 11:13 AM To: Bailey, Daniel Cc: Sarah Goslee; r-help@r-project.org Subject: Re: [R] getting data associated with coordinates

Re: [R] getting data associated with coordinates in a spatial data frame

2011-10-13 Thread R. Michael Weylandt
a > specific location? > > The following: > e[e$coordinates==(0,17),] > Doesn't work. > > > -Original Message- > From: Sarah Goslee [mailto:sarah.gos...@gmail.com] > Sent: Wednesday, October 12, 2011 5:34 PM > To: Bailey, Daniel > Cc: r-help@r-project.

Re: [R] getting data associated with coordinates in a spatial data frame

2011-10-13 Thread Bailey, Daniel
ay, October 12, 2011 5:34 PM To: Bailey, Daniel Cc: r-help@r-project.org Subject: Re: [R] getting data associated with coordinates in a spatial data frame Hi, On Wed, Oct 12, 2011 at 3:37 PM, Bailey, Daniel wrote: > If I know the specific coordinate in a spatial data frame, how can I access

Re: [R] getting data associated with coordinates in a spatial data frame

2011-10-12 Thread Sarah Goslee
Hi, On Wed, Oct 12, 2011 at 3:37 PM, Bailey, Daniel wrote: > If I know the specific coordinate in a spatial data frame, how can I access > the data at that coordinate? > > My coordinates are labeled "x" and "y" in a data.frame "e". The data is in > column "leachate". > I want to say, basically:

[R] getting data associated with coordinates in a spatial data frame

2011-10-12 Thread Bailey, Daniel
If I know the specific coordinate in a spatial data frame, how can I access the data at that coordinate? My coordinates are labeled "x" and "y" in a data.frame "e". The data is in column "leachate". I want to say, basically: e$leachate@coordinates(2,3). Thanks