Skip to content
Prev 19844 / 29559 Next

Problem with cell numbers when using a raster extent object

Ned,

Hard to see what does not work here. Perhaps it is just the [i] in
xyFromCell(predImage, sampleCells[i])?
Can you please provide a self-contained example, perhaps based on the below?

library(raster)
r <- raster(system.file("external/rlogo.grd", package="raster"))
e <- extent(r) + 100
s <- sampleRandom(r, size=100, cells=TRUE, extent=e)[,1]
xy <- xyFromCell(r, s)

plot(e)
plot(r, add=T, legend=F)
points(xy)
On Mon, Nov 25, 2013 at 9:42 AM, Ned Horning <horning at amnh.org> wrote: