# NOT RUN {
r <- raster()
extent(r)
extent(c(0, 20, 0, 20))
#is equivalent to
extent(0, 20, 0, 20)
extent(matrix(c(0, 0, 20, 20), nrow=2))
x <- list(x=c(0,1,2), y=c(-3,5))
extent(x)
#crop the extent by row and column numbers
extent(r, 1, 20, 10, 30)
# }
Run the code above in your browser using DataLab