Re: [R-sig-Geo] sampling a raster within a polygon

2017-10-24 Thread Bacou, Melanie
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

Re: [R-sig-Geo] sampling a raster within a polygon

2017-10-24 Thread Bacou, Melanie
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

Re: [R-sig-Geo] Plotting GPS Coordinates on a Polar Projection Using rgdal

2017-10-24 Thread clark richards
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),