Skip to content
Prev 9815 / 29559 Next

problems with points2grid

Yan,

An alternative approach, if you want to force regularly spaced points
to a grid that you know the parameters of, you could first create that
grid and then link the values by cell numbers

library(raster)
r <- raster(ncol=10, nrow=10, xmn=..  xmx=  etc)
cells <- cellFromXY(r, xy)
r[cells] <- value

(not to be confused with pointsToRaster for random like distributions
with perhaps multiple points per cell).

Robert
On Mon, Nov 1, 2010 at 7:03 PM, Yan Boulanger <yan_boulanger at hotmail.com> wrote: