unitname: Name for Unit of Length

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/units.R

Description

Inspect or change the name of the unit of length in a spatial dataset.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
unitname(x)
## S3 method for class 'dppm'
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)
## S3 method for class 'tess'
unitname(x)
unitname(x) <- value
## S3 replacement method for class 'dppm'
unitname(x) <- value
## S3 replacement method for class 'im'
unitname(x) <- value
## S3 replacement method for class 'kppm'
unitname(x) <- value
## S3 replacement method for class 'minconfit'
unitname(x) <- value
## S3 replacement method for class 'owin'
unitname(x) <- value
## S3 replacement method for class 'ppm'
unitname(x) <- value
## S3 replacement method for class 'ppp'
unitname(x) <- value
## S3 replacement method for class 'psp'
unitname(x) <- value
## S3 replacement method for class 'quad'
unitname(x) <- value
## S3 replacement method for class 'slrm'
unitname(x) <- value
## S3 replacement method for class 'tess'
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"), a tessellation (object of class "tess"), a quadrature scheme (object of class "quad"), or a fitted point process model (object of class "ppm" or "kppm" or "slrm" or "dppm" or "minconfit").

value

Name of the unit of length. See Details.

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.

unitname(x) extracts this name, and unitname(x) <- value sets the name to value.

A valid name is either

Note that re-setting the name of the unit of length does not affect the numerical values in 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 "unitname" containing the name of the unit of length in x. There are methods for print, summary, as.character, rescale and compatible.

Author(s)

\spatstatAuthors

.

See Also

rescale, owin, ppp

Examples

1
2
3
4
5
6
7
  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)

spatstat documentation built on Nov. 5, 2018, 1:04 a.m.