[R-sig-Geo] Identifying the cell that points are associated with?

2012-02-01 Thread ADAM PETER CARDILINI
G'day All, I have been struggling to figure out an answer to this question and wasn't sure where else to ask, so here goes. I have a large amount of presence/absence point data (~125,000) with lon/lat coordinates. Like this: Lat lon abs/pres

Re: [R-sig-Geo] Identifying the cell that points are associated with?

2012-02-01 Thread Tom Gottfried
Have a look at ?sp::over regards, Tom Am 02.02.2012 06:13, schrieb ADAM PETER CARDILINI: G'day All, I have been struggling to figure out an answer to this question and wasn't sure where else to ask, so here goes. I have a large amount of presence/absence point data (~125,000) with lon/lat

Re: [R-sig-Geo] Identifying the cell that points are associated with?

2012-02-02 Thread Lyndon Estes
Hi Adam, Here is code for something very similar that I was doing, which should help with what you want to do. In this case, I made grids of varying resolution to cover the extent of the area defined by my points, and then collected the grid ids for each resolution and bound them to the SpatialPoi

Re: [R-sig-Geo] Identifying the cell that points are associated with?

2012-02-02 Thread Robert J. Hijmans
Adam, Assuming your data are in a data.frame 'd' library(raster) r <- raster() res(r) <- 1/120 cellID <- cellFromXY(r, d[, c('lon', 'Lat')] ) Robert On Wed, Feb 1, 2012 at 9:13 PM, ADAM PETER CARDILINI wrote: > G'day All, > > > > I have been struggling to figure out an answer to this question