units {spatstat} | R Documentation |
Inspect or change the name of the unit of length in a spatial dataset.
units(x) ## S3 method for class 'ppp': units(x) ## S3 method for class 'psp': units(x) ## S3 method for class 'owin': units(x) ## S3 method for class 'im': units(x) units(x) <- value ## S3 method for class 'ppp': units(x) <- value ## S3 method for class 'psp': units(x) <- value ## S3 method for class 'owin': units(x) <- value ## S3 method for class 'im': units(x) <- value
x |
A spatial dataset.
Either a point pattern (object of class "ppp" ),
a line segment pattern (object of class "psp" ),
a window (object of class "owin" ) or
a pixel image (object of class "im" ).
|
value |
Name of the unit of length. See Details. |
Spatial datasets in the spatstat package may include the name of the unit of length. This name is used when printing or plotting the dataset, and in some other applications.
units(x)
extracts this name,
and units(x) <- value
sets the name to value
.
A valid name is either
The return value of units
is an object of class "units"
containing the name of the unit of length in x
. There are
methods for print
and summary
.
Adrian Baddeley adrian@maths.uwa.edu.au http://www.maths.uwa.edu.au/~adrian/ and Rolf Turner rolf@math.unb.ca http://www.math.unb.ca/~rolf
X <- runifpoint(20) # if the unit of length is 1 metre: units(X) <- c("metre", "metres") # if the unit of length is 6 inches: units(X) <- list("inch", "inches", 6)