powered by
Rescales a dataset so that the values range exactly between the specified limits.
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))
An object of the same type as x.
x
Data to be rescaled.
Lower and upper endpoints of the interval to which the values of x should be rescaled.
Optional range of values of x that should be mapped to the new interval.
Adrian Baddeley Adrian.Baddeley@curtin.edu.au
and Rolf Turner rolfturner@posteo.net
These functions rescale a dataset x so that its values range exactly between the limits from and to.
from
to
The method for pixel images (objects of class "im") applies this scaling to the pixel values of x.
"im"
Rescaling cannot be performed if the values in x are not interpretable as numeric, or if the values in x are all equal.
scale
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