Learn R Programming

raster (version 1.0.0-1)

resample: Resample

Description

Resample transfers values between non matching RasterLayers (in terms of origin and resolution). Avoid using this function if you can use functions like (dis)aggregate, crop and merge instead, because these functions are more accurate and much faster.

Usage

resample(from, to, method="ngb", filename="", ...)

Arguments

from
a RasterLayer object
to
a Raster* object
method
method used to compute values for the new RasterLayer
filename
character. output filename
...
additional arguments. See Details.

Value

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

Details

valid values for method are 'ngb' (nearest neighbor) and 'bilinear' (bilinear interpolation). The following additional arguments can be passed, to replace default values for this function rll{ 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. Valid values are "text", "tcltk", "windows" (on that platform only) and "" }

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