plot.sphppm: Plot Fitted Point Process Intensity

View source: R/plot.sphppm.R

plot.sphppmR Documentation

Plot Fitted Point Process Intensity

Description

Plot the fitted intensity of a point process model as an image wrapped on the sphere.

Usage

## S3 method for class 'sphppm'
plot(x,
             eye = place("nedlands"), top = place("northpole"),
             w,
             ...,
             eps = NULL, dimyx = NULL, main = "",
             action = c("image", "contour", "imagecontour"),
             col.image = NULL, col.lines = NULL)

Arguments

x

Fitted point process model on the sphere (object of class "sphppm").

eye

Viewpoint. A vector of length 3 (or a pair of list(lon,lat) coordinates, in degrees) determining a position in space.

top

Vector of length 3 (or a pair of list(lon,lat) coordinates, in degrees) determining a position in space. The plot will be rotated so that this position appears to be directly above the centre of the earth.

w

Spherical window (object of class "sphwin") in which the fitted intensity should be plotted. Default is the window of the original data to which the model was fitted.

...

Additional arguments controlling the plot, passed to plot.im or contour.im.

eps,dimyx

Arguments passed to as.mask controlling the resolution of the final plotted image.

main

Main title. A character string, character vector, or expression.

action

Character string specifying how the fitted intensity should be plotted. See Details.

col.image

Optional. A vector of colour values (a character vector which can be interpreted as colours) or an object of class "colourmap" determining the colour map for the image plot, if action="image" or action="imagecontour". Overrides the argument col if it is present.

col.lines

Optional. A single colour (a character string or integer which can be interpreted as a colour) to be used for the contour lines, if action="contour" or action="imagecontour". Overrides the argument col if it is present.

Details

This function computes the intensity of the fitted model x at essentially every location on the sphere, and produces a colour image plot and/or contour plot, showing the sphere viewed from a particular spatial position.

Options are action="image" to produce a colour image, action="contour" for a contour plot, and action="imagecontour" for both a colour image with contour lines superimposed.

The algorithm runs as follows: First the intensity of the fitted model x is computed at a fine grid of locations on the sphere. Those grid locations which are visible from the viewing location eye are projected onto a two-dimensional plane. The values at these projected locations are interpolated onto a two-dimensional rectangular pixel grid by kernel smoothing, using Smooth.ppp, with a very small bandwidth sigma. The resulting two-dimensional pixel image is then plotted by plot.im and/or a contour map is drawn by contour.im.

To control colours in the plot, the argument col can be used if this is unambiguous (i.e. if action="image" or action="contour"). Otherwise the arguments col.image and col.lines determine the colours used in the image and contour plots, respectively.

Note that the plot shows the half of the sphere that is visible from the eye position (i.e. all locations u for which d(u,eye) <= pi*rho/2, where rho is the radius of the sphere).

Value

Null.

Author(s)

Adrian Baddeley.

See Also

sphppm, predict.sphppm

Examples

  XX <- runif.sphwin(100)
  fit <- sphppm(XX ~ x1+ x2 + x3)
  plot(fit)
  plot(fit, dimyx=256)
  globedrawlong(seq(0, 350, by=10))
  globedrawlat(seq(-80,80,by=10))
  plot(fit, dimyx=256, col=heat.colors(128))
  plot(fit, dimyx=256, action="contour", col="green")
  plot(fit, dimyx=256, action="imagecontour",
                col.image=topo.colors(128), col.lines="white")

baddstats/spherstat documentation built on Feb. 6, 2023, 1:45 a.m.