Crop a section out of a nativeRaster into a new nativeRaster
nr_crop(nr, x, y, w, h)
nr_crop2(nr, loc)
Arguments
- nr
nativeRaster
- x, y, w, h
dimensions of cropped section
- loc
dimensions of cropped section. A vector of 4 values
i.e. c(x, y, w, h)
Examples
nr <- nr_new(400, 400, 'hotpink')
nr2 <- nr_crop(nr, 0, 0, 10, 10)
dim(nr2)
#> [1] 10 10
plot(nr2)