nr_resize: Resize a native raster by specifying the output dimensions

View source: R/nr-scale.R

nr_resizeR Documentation

Resize a native raster by specifying the output dimensions

Description

Resize a native raster by specifying the output dimensions

Usage

nr_resize(nr, width, height, algo = "nn")

Arguments

nr

native raster image

width, height

dimensions for output image

algo

'nn' for nearest neighbor (the default), or 'bilinear' for bilinear interpolation.

Value

New native raster image

See Also

Other resizing functions: nr_scale()

Examples

stretched <- deer[[1]] |> 
    nr_copy() |> 
    nr_resize(100, 40, algo = 'nn')
plot(stretched)

nara documentation built on May 28, 2026, 5:07 p.m.