resampleBy: Resample a numeric RasterLayer

Description Usage Arguments Value Examples

Description

Resample a numeric RasterLayer

Usage

1
2
3
resampleBy(x, factor, method = c("bilinear", "ngb"))

resampleTo(x, nrow = 180, ncol = 360, method = c("bilinear", "ngb"))

Arguments

x

RasterLayer object to be resampled. Currently it MUST be backed by a .grd file and must have numeric data.

factor

Factor to resize by (for example, 0.5 for 50%, 3.2 for 320%).

method

"bilinear" for bilinear interpolation, or "ngb" for nearest-neighbor.

nrow,ncol

Number of rows and columns in the output layer.

Value

Resampled raster.

Examples

1
2
3
4
5
library(raster)
src <- raster(system.file("sample.grd", package = "rasterfaster"))
plot(src)
system.time(result <- resampleBy(src, 8.4))
plot(result)

jcheng5/rasterfaster documentation built on May 18, 2019, 10:22 p.m.