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

ppp.object

Class of Point Patterns


Description

A class "ppp" to represent a two-dimensional point pattern. Includes information about the window in which the pattern was observed. Optionally includes marks.

Details

This class represents a two-dimensional point pattern dataset. It specifies

  • the locations of the points

  • the window in which the pattern was observed

  • optionally, “marks” attached to each point (extra information such as a type label).

If X is an object of type ppp, it contains the following elements:

x vector of x coordinates of data points
y vector of y coordinates of data points
n number of points
window window of observation
(an object of class owin)
marks optional vector or data frame of marks

Users are strongly advised not to manipulate these entries directly.

Objects of class "ppp" may be created by the function ppp and converted from other types of data by the function as.ppp. Note that you must always specify the window of observation; there is intentionally no default action of “guessing” the window dimensions from the data points alone.

Standard point pattern datasets provided with the package include amacrine, betacells, bramblecanes, cells, demopat, ganglia, lansing, longleaf, nztrees, redwood, simdat and swedishpines.

Point patterns may be scanned from your own data files by scanpp or by using read.table and as.ppp.

They may be manipulated by the functions [.ppp and superimpose.

Point pattern objects can be plotted just by typing plot(X) which invokes the plot method for point pattern objects, plot.ppp. See plot.ppp for further information.

There are also methods for summary and print for point patterns. Use summary(X) to see a useful description of the data.

Patterns may be generated at random by runifpoint, rpoispp, rMaternI, rMaternII, rSSI, rNeymanScott, rMatClust, and rThomas.

Most functions which are intended to operate on a window (of class owin) will, if presented with a ppp object instead, automatically extract the window information from the point pattern.

Warnings

The internal representation of marks is likely to change in the next release of this package.

Author(s)

and Rolf Turner r.turner@auckland.ac.nz

See Also

Examples

x <- runif(100)
  y <- runif(100)
  X <- ppp(x, y, c(0,1),c(0,1))
  X
  if(human <- interactive()) plot(X)
  mar <- sample(1:3, 100, replace=TRUE)
  mm <- ppp(x, y, c(0,1), c(0,1), marks=mar)
  if(human) plot(mm)
  # points with mark equal to 2
  ss <- mm[ mm$marks == 2 , ]
  if(human) plot(ss)
  # left half of pattern 'mm'
  lu <- owin(c(0,0.5),c(0,1))
  mmleft <- mm[ , lu]
  if(human) plot(mmleft)
  if(FALSE) {
  # input data from file
  qq <- scanpp("my.table", unit.square())
  # interactively build a point pattern
  plot(unit.square())
  X <- as.ppp(locator(10), unit.square())
  plot(X)
  }

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.