Learn R Programming

spatstat.geom (version 3.7-0)

scaletointerval: Rescale Data to Lie Between Specified Limits

Description

Rescales a dataset so that the values range exactly between the specified limits.

Usage

scaletointerval(x, from=0, to=1, xrange=range(x))
  # S3 method for default
scaletointerval(x, from=0, to=1, xrange=range(x))
  # S3 method for im
scaletointerval(x, from=0, to=1, xrange=range(x))

Arguments

Value

An object of the same type as x.

Details

These functions rescale a dataset x so that its values range exactly between the limits from and to.

The method for pixel images (objects of class "im") applies this scaling to the pixel values of x.

Rescaling cannot be performed if the values in x are not interpretable as numeric, or if the values in x are all equal.

See Also

Examples

Run this code
  X <- as.im(function(x,y) {x+y+3}, unit.square())
  summary(X)
  Y <- scaletointerval(X)
  summary(Y)

Run the code above in your browser using DataLab