Skip to contents

Linearly rescale element values in a raster to a range between 0 and 1.

Usage

util_rescale(x)

util_rescale(x)

Arguments

x

Raster* object

Value

Raster* object with values ranging from 0-1

Details

Rasters generated by nlm_ functions are scaled between 0 and 1 as default, this option can be set to FALSE if needed.

Examples

unscaled_landscape <- gradient_landscape + fractal_landscape
util_rescale(unscaled_landscape)
#> class      : RasterLayer 
#> dimensions : 150, 150, 22500  (nrow, ncol, ncell)
#> resolution : 1, 1  (x, y)
#> extent     : 0, 150, 0, 150  (xmin, xmax, ymin, ymax)
#> crs        : NA 
#> source     : memory
#> names      : layer 
#> values     : 0, 1  (min, max)
#>