crop
if you (also) want to remove rows or columns.expand(x, y, ...)
filename
filename for the output RasterLayer. Default=''
overwrite
Logical. If TRUE
, "filename" will be overwritten if it exists
format
Character. Output file type. See writeRaster
datatype
Character. Output data type. See dataType
progress
Character. "text", "window", or "" (the default, no progress bar)
}crop
, merge
r <- raster(xmn=-150, xmx=-120, ymx=60, ymn=30, ncol=36, nrow=18)
r[] <- 1:ncell(r)
bb <- extent(-180, 0, 0, 90)
re <- expand(r, bb)
Run the code above in your browser using DataLab