projectRaster
if the target has a different projection.
Before using resample, you may want to consider using these other functions instead: aggregate
, disaggregate
, crop
, expand
, merge
.resample(x, y, ...)
x
should be resample tomethod
method used to compute values for the new RasterLayer, should be "bilinear" for bilinear interpolation, or "ngb" for nearest neighbor
filename
character. output filename
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)
}aggregate
, disaggregate
, crop
, expand
, merge
, projectRaster
r <- raster(nrow=3, ncol=3)
r[] <- 1:ncell(r)
s <- raster(nrow=10, ncol=10)
s <- resample(r, s, method='bilinear')
#par(mfrow=c(1,2))
#plot(r)
#plot(s)
Run the code above in your browser using DataLab