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

Tom Gottfried tom.gottfried at tum.de
Thu Feb 2 06:34:57 CET 2012


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 coordinates. Like this:
>
> Lat                          lon                          abs/pres              date
>
> 113.6481              -24.90278             0                              1/1/1998
>
> 113.6481              -24.90278             1                              1/2/1998
>
> 113.6481              -24.90278             0                              1/3/1998
>
> 137.5175              -35.69556             1                              1/1/1998
>
> 137.5175              -35.69556             1                              1/2/1998
>
> 137.5175              -35.69556             1                              1/3/1998
>
>
>
> I have been trying to work out a way to identify the cells that each point would fall into if it were mapped onto a raster grid (I am using rasters with the same cell resolution as BIOCLIM rasters). That is, for all points falling within the same cell, I would like to identify them as being a part of the same cell. I am trying to model site occupancy for this species from repeated survey data, using the package 'unmarked', which requires records to be associated with sites. I don't have site IDs with this data so I need to come up with a proxy for this. I thought I could use grid cell id as a proxy for site id, so that all records that fall within the same grid cell can be considered the same site.
>
> How do I identify the grid cell that each point falls into on a raster grid and associate it with my presence/absence data, to produce a dataset that looks like this?
>
> Lat                          lon                          abs/pres              date                       cellID
>
> 113.6481              -24.90278             0                              1/1/1998              234
>
> 113.6481              -24.90278             1                              1/2/1998              234
>
> 113.6481              -24.90278             0                              1/3/1998              234
>
> 137.5175              -35.69556             1                              1/1/1998              250
>
> 137.5175              -35.69556             1                              1/2/1998              250
>
> 137.5175              -35.69556             1                              1/3/1998              250
>
>
>
> Thanks for your help in advance.
>
>
>
> Kind regards,
>
> Adam Cardilini
>
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

-- 
Technische Universität München
Department für Pflanzenwissenschaften
Lehrstuhl für Grünlandlehre
Alte Akademie 12
85350 Freising / Germany
Phone: ++49 (0)8161 715324
Fax:   ++49 (0)8161 713243
email: tom.gottfried at wzw.tum.de
http://www.wzw.tum.de/gruenland



More information about the R-sig-Geo mailing list