normalize: Normalize data in the range '0' to '1'.

Description Usage Arguments Value Methods (by class) Examples

View source: R/group_base_subgroup_per_pixel.R

Description

Normalize data lying between mn and mx in the range 0 to 1. Data greater than mx get values greater than 1, proportionally. Conversely, data less than mn get values less than 0.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
normalize(x, mn, mx, ...)

## S4 method for signature 'Raster'
normalize(x, mn, mx, ...)

## S4 method for signature 'RasterLayer'
normalize(x, mn, mx, ...)

## S4 method for signature 'CanopyPhoto'
normalize(x, mn, mx, ...)

Arguments

x

CanopyPhoto or Raster.

mn

One-length numeric. Minimum expected value.

mx

One-length numeric. Maximum expected value.

...

Additional arguments as for writeRaster.

Value

CanopyPhoto or Raster

Methods (by class)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
x <- 0:100
summary(normalize(x, 0, 100))
summary(normalize(x, 25, 75))
summary(normalize(x, 50, 75))

x <- normalize(loadPhoto(), 0, 255)
getMin(x)
getMax(x)
x <- normalize(loadPhoto(), 100, 200)
getMin(x)
getMax(x)

GastonMauroDiaz/caiman documentation built on Jan. 22, 2022, 4:43 a.m.