# NOT RUN {
r <- rast(xmin=-150, xmax=-120, ymin=30, ymax=60, ncol=36, nrow=18)
values(r) <- 1:ncell(r)
e <- ext(-180, -100, 40, 70)
re <- extend(r, e)
# extend with a number of rows and columns (at each side)
re2 <- extend(r, c(2,10))
# Extent object
e <- ext(r)
e
extend(e, 10)
extend(e, 10, -10, 0, 20)
#e + 10
#e * 2
# }
Run the code above in your browser using DataLab