[R-sig-Geo] crop by pixel

Alfredo Alessandrini alfreale74 at gmail.com
Tue Jul 26 15:33:46 CEST 2011


Hi,

I need to crop a raster by pixel value, from upper X,Y left.

I'm using this:

spot <- raster(.........)

x_shift <- 2

y_shift <- 2

crop(spot,extent(xmin(spot)+res(spot)[1]*x_shift,xmax(spot),ymin(spot),ymax(spot)-res(spot)[2]*y_shift))


It's work, but is there another way?



Thanks,

Alfredo



More information about the R-sig-Geo mailing list