Sorry the exact code is:
xy.r <- extract(r, xy.sp)
xy.r.sample <- lapply(xy.r, sample, 10)
On 10/24/2017 01:34 PM, Bacou, Melanie
wrote:
Andy,
Simple use `extract()` instead of `mask()`, and then randomly
sample cells
Andy,
Simple use `extract()` instead of `mask()`, and then randomly
sample cells in each polygon. Should be much faster, e.g.:
xy.r <- extract(r, xy.sp)
xy.r.sample <- lapply(xy.r, sample.int, n=10)
--Mel.
On 10/23/2017 12:57 PM, Andy Bunn
I would definitely defer to Michael and the other true "Geo" folks on this
list**, but if you're ok with base graphics (and a much less technical
interface) you could accomplish what you want using the `oce` package:
library(oce)
data(coastlineWorld)
circ <- list(longitude=seq(-180, 180),