scaletointerval(x, from=0, to=1, xrange=range(x)) "scaletointerval"(x, from=0, to=1, xrange=range(x)) "scaletointerval"(x, from=0, to=1, xrange=range(x))
x
should be rescaled.
x
that should be mapped
to the new interval.
x
.
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.
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