Learn R Programming

raster (version 1.8-3)

resample: Resample a Raster object

Description

Resample transfers values between non matching Raster* objects (in terms of origin and resolution). Use 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.

Usage

resample(x, y, ...)

Arguments

x
Raster* object to be resampled
y
Raster* object with parameters that x should be resample to
...
additional arguments. See Details.

Value

  • A RasterLayer or RasterBrick object, and, in some cases, the side-effect of a file with the values of the new RasterLayer

Details

The following additional arguments can be passed, to replace default values for this function rll{ method 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) }

See Also

aggregate, disaggregate, crop, expand, merge, projectRaster

Examples

Run this code
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