Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

headtail

First or Last Part of a Spatial Pattern


Description

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

Usage

## S3 method for class 'ppp'
head(x, n = 6L, ...)

  ## S3 method for class 'ppx'
head(x, n = 6L, ...)

  ## S3 method for class 'psp'
head(x, n = 6L, ...)

  ## S3 method for class 'tess'
head(x, n = 6L, ...)

  ## S3 method for class 'ppp'
tail(x, n = 6L, ...)

  ## S3 method for class 'ppx'
tail(x, n = 6L, ...)

  ## S3 method for class 'psp'
tail(x, n = 6L, ...)

  ## S3 method for class '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.

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner r.turner@auckland.ac.nz and Ege Rubak rubak@math.aau.dk.

See Also

Examples

head(cells)
  tail(edges(letterR), 5)
  head(dirichlet(cells), 4)

spatstat.geom

Geometrical Functionality of the 'spatstat' Family

v2.1-0
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Tilman Davies [ctb], Ute Hahn [ctb], Abdollah Jalilian [ctb], Sebastian Meyer [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Waagepetersen [ctb]
Initial release
2021-04-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.