Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Discrete Global Grid in R

I have a dataset consisting of latitude-longitude pairs associated with some Z value (e.g. data regarding degree of plant vegetation coverage).

I'd like to perform some analyses on the spatial distribution of this data.

To do so, it will be necessary to bin proximal data points.

I would like to do this with a Discrete Global Grid such as an Icosahedron Snyder Equal Area (ISEA) grid, or the grid produced by DGGRID.

The key is that the latitude-longitude values of the data can be convertable into unique cell ids, that the latitude-longitude of the cell's center be determinable, the size of the cells be variable (for analysis at different spatial scales), and that the cells be of equal area to a close approximation.

An image depicting how this might look:

Discrete Global Grid

Is there anything in R which does this?

like image 854
Richard Avatar asked Jul 02 '12 17:07

Richard


3 Answers

There is only one other lead I ever turned up for hexagonal gridding over a curved surface: some untested/beta functions for the hexbin package:

http://ugrad.stat.ubc.ca/R/library/hexbin/html/00Index.html

like image 107
Dr Raveem Ismail Avatar answered Nov 20 '22 10:11

Dr Raveem Ismail


I've just completed an R package called dggridR which wraps dggrid in an easy-to-use way.

The package is also available on CRAN.

dggridR: Discrete Global Grids for R

like image 39
Richard Avatar answered Nov 20 '22 11:11

Richard


Why not use DGGRID itself, which can do everything you asked? For example, you could use DGGRID to transform a text file of lat/lon/datavalue records into records of the form cellID/datavalue, and then import those into R.

like image 1
user1582836 Avatar answered Nov 20 '22 11:11

user1582836