headtail

0th

Percentile

First or Last Part of a Spatial Pattern

Returns the first few elements (head) or the last few elements (tail) of a spatial pattern.

Keywords
manip, spatial
Usage
# S3 method for ppp
head(x, n = 6L, …)

# S3 method for ppx head(x, n = 6L, …)

# S3 method for psp head(x, n = 6L, …)

# S3 method for tess head(x, n = 6L, …)

# S3 method for ppp tail(x, n = 6L, …)

# S3 method for ppx tail(x, n = 6L, …)

# S3 method for psp tail(x, n = 6L, …)

# S3 method for tess tail(x, n = 6L, …)

Arguments
x

A spatial pattern of geometrical figures, such as a spatial pattern of points (an object of class "ppp", "pp3", "ppx" or "lpp") or a spatial pattern of line segments (an object of class "psp") or a tessellation (object of class "tess").

n

Integer. The number of elements of the pattern that should be extracted.

Ignored.

Details

These are methods for the generic functions head and tail. They extract the first or last n elements from x and return them as an object of the same kind as x.

To inspect the spatial coordinates themselves, use View(x) or head(as.data.frame(x)).

Value

An object of the same class as x.

See Also

View, edit.

Conversion to data frame: as.data.frame.ppp, as.data.frame.ppx, as.data.frame.psp

Aliases
  • head.ppp
  • head.ppx
  • head.psp
  • head.tess
  • tail.ppp
  • tail.ppx
  • tail.psp
  • tail.tess
Examples
# NOT RUN {
  head(cells)
  tail(as.psp(spiders), 10)
  head(dirichlet(cells), 4)
# }
Documentation reproduced from package spatstat, version 1.59-0, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.