Ross,

I am not sure what exactly you mean with "randomly sample points within
each cell" but you can have a look at
library(dismo)
?gridSample

Robert

On Fri, Mar 8, 2013 at 5:49 AM, Mathieu Rajerison <
mathieu.rajerison@gmail.com> wrote:

> Sorry, I meant polygonize via raster::rasterToPolygons
>
> 2013/3/8 Mathieu Rajerison <mathieu.rajerison@gmail.com>
>
> > Hi,
> >
> > You could rasterize you layer then apply spsample function on each cell.
> >
> >
> > 2013/3/8 Ross Ahmed <rossahmed@googlemail.com>
> >
> >> The following code randomly samples cells within a raster:
> >>
> >> myRaster <- raster(ncol=10, nrow=10)
> >> values(myRaster) <- rnorm(ncell(myRaster))
> >> plot(myRaster)
> >> library(dismo)
> >> xy <- randomPoints(myRaster, n=100)
> >> points(xy)
> >>
> >> Is it possible to randomly sample points within each cell?
> >>
> >> Thanks
> >> Ross
> >>
> >>
> >>
> >>
> >>
> >>         [[alternative HTML version deleted]]
> >>
> >> _______________________________________________
> >> R-sig-Geo mailing list
> >> R-sig-Geo@r-project.org
> >> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >>
> >
> >
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]

