Convert dataset to another unit of length
Converts between different units of length in a spatial dataset, such as a point pattern or a window.
rescale(X, s, unitname)
- Any suitable dataset representing a two-dimensional
object, such as a point pattern (object of class
"ppp"), or a window (object of class
- Conversion factor: the new units are
stimes the old units.
- Optional. New name for the unit of length.
This is generic. Methods are provided for many spatial objects.
The spatial coordinates in the dataset
X will be re-expressed
in terms of a new unit of length that is
s times the current
unit of length given in
unitname is given, it will be taken as the new name of the unit
of length. It should be a valid name for the
unit of length, as described in the help for
For example if
X is a dataset giving coordinates in metres,
will divide the coordinate values by 1000 to obtain coordinates in
kilometres, and the unit name will be changed from
rescale(X, 1000, "km") will divide the coordinate
values by 1000 to obtain coordinates in
kilometres, and the unit name will be changed to
- Another object of the same type, representing the same data, but expressed in the new units.
The result of this operation is equivalent to the original dataset.
If you want to actually change the coordinates by
a linear transformation, producing a dataset that is not equivalent
to the original one, use