Skip to content
Prev 8922 / 29559 Next

how to do randomly sampling in raster layer

Dear Mao,

If r is a RasterLayer, you can also do

library(dismo)
xy <- randomPoints(r, n=100)

plot(r)
points(xy)


Best, Robert
On Tue, Aug 3, 2010 at 2:51 AM, Paul Hiemstra <p.hiemstra at geo.uu.nl> wrote: