unitname
From spatstat v1.36-0
by Adrian Baddeley
Name for Unit of Length
Inspect or change the name of the unit of length in a spatial dataset.
Usage
unitname(x)
## S3 method for class 'im':
unitname(x)
## S3 method for class 'kppm':
unitname(x)
## S3 method for class 'minconfit':
unitname(x)
## S3 method for class 'owin':
unitname(x)
## S3 method for class 'ppm':
unitname(x)
## S3 method for class 'ppp':
unitname(x)
## S3 method for class 'psp':
unitname(x)
## S3 method for class 'quad':
unitname(x)
## S3 method for class 'slrm':
unitname(x)
unitname(x) <- value
## S3 method for class 'im':
unitname(x) <- value
## S3 method for class 'kppm':
unitname(x) <- value
## S3 method for class 'minconfit':
unitname(x) <- value
## S3 method for class 'owin':
unitname(x) <- value
## S3 method for class 'ppm':
unitname(x) <- value
## S3 method for class 'ppp':
unitname(x) <- value
## S3 method for class 'psp':
unitname(x) <- value
## S3 method for class 'quad':
unitname(x) <- value
## S3 method for class 'slrm':
unitname(x) <- value
Arguments
- 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"
), a pixel image (object of class"im"
), - value
- Name of the unit of length. See Details.
Details
Spatial datasets in the
unitname(x)
extracts this name,
and unitname(x) <- value
sets the name to value
.
A valid name is either
- a single character string
- a vector of two character strings giving the singular and plural forms of the unit name
- a list of length 3, containing two character strings giving the singular and plural forms of the basic unit, and a number specifying the multiple of this unit.
x
. It changes only the string
containing the name of the unit of length. To rescale the numerical
values, use rescale
.
Value
- The return value of
unitname
is an object of class"units"
containing the name of the unit of length inx
. There are methods forprint
andsummary
.
See Also
Examples
X <- runifpoint(20)
# if the unit of length is 1 metre:
unitname(X) <- c("metre", "metres")
# if the unit of length is 6 inches:
unitname(X) <- list("inch", "inches", 6)
Community examples
Looks like there are no examples yet.