Learn R Programming

⚠️There's a newer version (3.3-1) of this package.Take me there.

spatstat (version 1.15-1)

Spatial Point Pattern analysis, model-fitting, simulation, tests

Description

A package for analysing spatial data, mainly Spatial Point Patterns, including multitype/marked points and spatial covariates, in any two-dimensional spatial region. Contains functions for plotting spatial data, exploratory data analysis, model-fitting, simulation, spatial sampling, model diagnostics, and formal inference. Data types include point patterns, line segment patterns, spatial windows, and pixel images. Point process models can be fitted to point pattern data. Cluster type models are fitted by the method of minimum contrast. Very general Gibbs point process models can be fitted to point pattern data using a function ppm similar to lm or glm. Models may include dependence on covariates, interpoint interaction and dependence on marks. Fitted models can be simulated automatically. Also provides facilities for formal inference (such as chi-squared tests) and model diagnostics (including simulation envelopes, residuals, residual plots and Q-Q plots).

Copy Link

Version

Install

install.packages('spatstat')

Monthly Downloads

16,590

Version

1.15-1

License

GPL (>= 2)

Maintainer

Adrian Baddeley

Last Published

April 1st, 2009

Functions in spatstat (1.15-1)

PairPiece

The Piecewise Constant Pairwise Interaction Point Process Model
closing.owin

Morphological Closing of a Window
cut.ppp

Classify Points in a Point Pattern
expand.owin

Expand Window By Factor
fitted.ppm

Fitted Conditional Intensity for Point Process Model
spatstat-internal

Internal spatstat functions
lurking

Lurking variable plot
convexhull.xy

Convex Hull of Points
erode.owin

Erode a Window
eval.fv

Evaluate Expression Involving Functions
plot.im

Plot a Pixel Image
Fest

Estimate the empty space function F
Kest.fft

K-function using FFT
bei

Tropical rain forest trees
Ldot

Multitype L-function (i-to-any)
matchingdist

Distance for a Point Pattern Matching
nztrees

New Zealand Trees Point Pattern
cut.im

Convert Pixel Image from Numeric to Factor
BadGey

Hybrid Geyer Point Process Model
plot.listof

Plot a List of Things
ppp.object

Class of Point Patterns
Jcross

Multitype J Function (i-to-j)
inside.owin

Test Whether Points Are Inside A Window
Jest

Estimate the J-function
Kdot.inhom

Inhomogeneous Multitype K Dot Function
pcf

Pair Correlation Function
pcfcross

Multitype pair correlation function
rmhmodel.default

Build Point Process Model for Metropolis-Hastings Simulation.
pixelquad

Quadrature Scheme Based on Pixel Grid
rjitter

Random Perturbation of a Point Pattern
Gcross

Multitype Nearest Neighbour Distance Function (i-to-j)
owin

Create a Window
angles.psp

Orientation Angles of Line Segments
reduced.sample

Reduced Sample Estimator using Histogram Data
allstats

Calculate four standard summary functions of a point pattern.
Kdot

Multitype K Function (i-to-any)
AreaInter

The Area Interaction Point Process Model
summary.psp

Summary of a Line Segment Pattern Dataset
pppmatching.object

Class of Point Matchings
project2segment

Move Point To Nearest Line
Kcross.inhom

Inhomogeneous Cross K Function
applynbd

Apply Function to Every Neighbourhood in a Point Pattern
pppmatching

Create a Point Matching
Iest

Estimate the I-function
fryplot

Fry Plot of Point Pattern
Ord

Generic Ord Interaction model
bramblecanes

Hutchings' Bramble Canes data
eroded.areas

Areas of Morphological Erosions
contour.im

Contour plot of pixel image
ants

Harkness-Isham ants' nests data
as.data.frame.ppp

Coerce Point Pattern to a Data Frame
compatible.fv

Test Whether Two Function Objects Are Compatible
area.owin

Area of a Window
as.psp

Convert Data To Class psp
SatPiece

Piecewise Constant Saturated Pairwise Interaction Point Process Model
endpoints.psp

Endpoints of Line Segment Pattern
clickpoly

Interactively Define a Polygon
distmap.psp

Distance Map of Line Segment Pattern
is.multitype.ppp

Test Whether A Point Pattern is Multitype
diameter

Diameter of a Window
cells

Biological Cells Point Pattern
spatstat

The Spatstat Package
eval.fasp

Evaluate Expression Involving Function Arrays
Poisson

Poisson Point Process Model
Kcross

Multitype K Function (Cross-type)
Jmulti

Marked J Function
as.owin

Convert Data To Class owin
Linhom

L-function
is.im

Test Whether An Object Is A Pixel Image
anemones

Beadlet Anemones Data
pairdist.default

Pairwise distances
as.mask

Pixel Image Approximation of a Window
complement.owin

Take Complement of a Window
dirichlet

Dirichlet Tessellation of Point Pattern
affine

Apply Affine Transformation
compatible.fasp

Test Whether Two Function Arrays Are Compatible
is.ppp

Test Whether An Object Is A Point Pattern
plot.ppm

plot a Fitted Point Process Model
Strauss

The Strauss Point Process Model
crossing.psp

Crossing Points of Two Line Segment Patterns
incircle

Find Largest Circle Inside Window
rescale.owin

Convert Window to Another Unit of Length
is.ppm

Test Whether An Object Is A Fitted Point Process Model
heather

Diggle's Heather Data
copper

Berman-Huntington points and lines data
rpoispp

Generate Poisson Point Pattern
Geyer

Geyer's Saturation Point Process Model
concatxy

Concatenate x,y Coordinate Vectors
union.quad

Union of Data and Dummy Points
nndist.psp

Nearest neighbour distances between line segments
model.matrix.ppm

Extract Design Matrix from Point Process Model
kaplan.meier

Kaplan-Meier Estimator using Histogram Data
interp.im

Interpolate a Pixel Image
markcorr

Mark Correlation Function
delaunay

Delaunay Triangulation of Point Pattern
summary.im

Summarizing a Pixel Image
Kest

K-function
intersect.owin

Intersection or Union of Two Windows
density.psp

Kernel Smoothing of Line Segment Pattern
areadiff

Difference of Disc Areas
coef.ppm

Coefficients of Fitted Point Process Model
adaptive.density

Intensity Estimate of Point Pattern Using Tessellation
nncorr

Nearest-Neighbour Correlation of Marked Point Pattern
gridweights

Compute Quadrature Weights Based on Grid Counts
effectfun

Compute Fitted Effect of a Spatial Covariate in a Point Process Model
affine.psp

Apply Affine Transformation To Line Segment Pattern
pcf.fasp

Pair Correlation Function obtained from array of K functions
is.marked.ppm

Test Whether A Point Process Model is Marked
[.quad

Subset of Quadrature Scheme
affine.owin

Apply Affine Transformation To Window
crossdist

Pairwise distances
hamster

Aherne's hamster tumour data
corners

Corners of a rectangle
crossdist.psp

Pairwise distances between two different line segment patterns
Gdot

Multitype Nearest Neighbour Distance Function (i-to-any)
is.marked.ppp

Test Whether A Point Pattern is Marked
default.dummy

Generate a Default Pattern of Dummy Points
rescue.rectangle

Convert Window Back To Rectangle
chorley

Chorley-Ribble Cancer Data
DiggleGratton

Diggle-Gratton model
distmap.ppp

Distance Map of Point Pattern
betacells

Beta Ganglion Cells in Cat Retina
harmonic

Basis for Harmonic Functions
data.ppm

Extract Original Data from a Fitted Point Process Model
markstat

Summarise Marks in Every Neighbourhood in a Point Pattern
density.splitppp

Kernel Smoothed Intensity of Split Point Pattern
fasp.object

Function Arrays for Spatial Patterns
discretise

Safely Convert Point Pattern Window to Binary Mask
demopat

Artificial Data Point Pattern
persp.im

Perspective Plot of Pixel Image
dilate.owin

Dilate a Window
opening.owin

Morphological Opening of a Window
levelset

Level Set of a Pixel Image
diagnose.ppm

Diagnostic Plots for Fitted Point Process Model
japanesepines

Japanese Pines Point Pattern
plot.fv

Plot Function Valuesn
scanpp

Read Point Pattern From Data File
rlabel

Random Re-Labelling of Point Pattern
im

Create a Pixel Image Object
Lcross

Multitype L-function (cross-type)
nbfires

Point Patterns of New Brunswick Forest Fires
MultiStrauss

The Multitype Strauss Point Process Model
pairdist

Pairwise distances
profilepl

Profile Maximum Pseudolikelihood
rotate.psp

Rotate a Line Segment Pattern
plot.ppp

plot a Spatial Point Pattern
marktable

Tabulate Marks in Neighbourhood of Every Point in a Point Pattern
reach

Interaction Distance of a Point Process
eval.hyper

Evaluate an Expression in Each Row of a Hyperframe
pixellate

Convert Point Pattern to Pixel Image
quadrat.test

Chi-Squared Dispersion Test for Spatial Point Pattern Based on Quadrat Counts
MultiStraussHard

The Multitype/Hard Core Strauss Point Process Model
intersect.tess

Intersection of Two Tessellations
km.rs

Kaplan-Meier and Reduced Sample Estimator using Histograms
quadrat.test.splitppp

Chi-Squared Test of CSR for Split Point Pattern
plot.quad

plot a Spatial Quadrature Scheme
thomas.estK

Fit the Thomas Point Process by Minimum Contrast
Kinhom

Inhomogeneous K-function
split.ppp

Divide Point Pattern into Sub-patterns
rpoisline

Generate Poisson Random Line Process
ord.family

Ord Interaction Process Family
ponderosa

Ponderosa Pine Tree Point Pattern
multiplicity.ppp

Count Multiplicity of Duplicate Points
ppm.object

Class of Fitted Point Process Models
as.rectangle

Window Frame
square

Square Window
print.psp

Print Brief Details of a Line Segment Pattern Dataset
kppm

Fit cluster point process model
predict.kppm

Prediction from a Fitted Cluster Point Process Model
plot.plotppm

Plot a plotppm Object Created by plot.ppm
qqplot.ppm

Q-Q Plot of Residuals from Fitted Point Process Model
bounding.box.xy

Convex Hull of Points
nncross

Nearest Neighbour in Another Point Pattern
colourmap

Colour Lookup Tables
rsyst

Simulate systematic random point pattern
rescale.psp

Convert Line Segment Pattern to Another Unit of Length
rmhcontrol

Set Control Parameters for Metropolis-Hastings Algorithm.
inforder.family

Infinite Order Interaction Family
rshift.ppp

Randomly Shift a Point Pattern
swedishpines

Swedish Pines Point Pattern
im.object

Class of Images
Saturated

Saturated Pairwise Interaction model
as.matrix.im

Convert Pixel Image to Matrix
by.im

Apply Function to Image Broken Down by Factor
Jdot

Multitype J Function (i-to-any)
lengths.psp

Lengths of Line Segments
pairdist.psp

Pairwise distances between line segments
miplot

Morishita Index Plot
clarkevans

Clark and Evans Aggregation Index
rMatClust

Simulate Matern Cluster Process
plot.fasp

Plot a Function Array
rmpoispp

Generate Multitype Poisson Point Pattern
rGaussPoisson

Simulate Gauss-Poisson Process
Hest

Spherical Contact Distribution Function
LennardJones

The Lennard-Jones Potential
clickppp

Interactively Add Points
plot.psp

plot a Spatial Line Segment Pattern
amacrine

Hughes' Amacrine Cell Data
distmap.owin

Distance Map of Window
by.ppp

Apply a Function to a Point Pattern Broken Down by Factor
anova.ppm

ANOVA for Fitted Point Process Models
bdist.points

Distance to Boundary of Window
Gmulti

Marked Nearest Neighbour Distance Function
rescale.im

Convert Pixel Image to Another Unit of Length
eval.im

Evaluate Expression Involving Pixel Images
tess

Create a Tessellation
pcf.ppp

Pair Correlation Function of Point Pattern
fitin.ppm

Extract the Interaction from a Fitted Point Process Model
vertices

Vertices of a Window
density.ppp

Kernel Smoothed Intensity of Point Pattern
distmap

Distance Map
plot.hyperframe

Plot Entries in a Hyperframe
is.owin

Test Whether An Object Is A Window
gridcentres

Rectangular grid of points
dirichlet.weights

Compute Quadrature Weights Based on Dirichlet Tessellation
is.multitype.ppm

Test Whether A Point Process Model is Multitype
ewcdf

Weighted Empirical Cumulative Distribution Function
pairdist.ppp

Pairwise distances
midpoints.psp

Midpoints of Line Segment Pattern
spruces

Spruces Point Pattern
fv.object

Data Frames of Function Values
rmhstart

Determine Initial State for Metropolis-Hastings Simulation.
stieltjes

Compute Integral of Function Against Cumulative Distribution
rescale.ppp

Convert Point Pattern to Another Unit of Length
envelope

Simulation envelopes of summary function
identify.ppp

Identify Points in a Point Pattern
spatstat-deprecated

Deprecated spatstat functions
longleaf

Longleaf Pines Point Pattern
logLik.ppm

Log Likelihood for Poisson Point Process Model
subsetget.im

Reset Values in Subset of Image
psp.object

Class of Line Segment Patterns
rthin

Random Thinning
rotate.owin

Rotate a Window
mincontrast

Method of Minimum Contrast
plot.kppm

Plot a fitted cluster point process
model.images

Compute Images of Constructed Covariates
kstest.ppm

Kolmogorov-Smirnov Test for Point Process Model
rpoisppOnLines

Generate Poisson Point Pattern on Line Segments
selfcrossing.psp

Crossing Points in a Line Segment Pattern
setcov

Set Covariance of a Window
subset.fv

Extract Subset of Function Values
pppdist

Distance Between Two Point Patterns
summary.ppm

Summarizing a Fitted Point Process Model
shift

Apply Vector Translation
ppm

Fit Point Process Model to Data
Gest

Nearest Neighbour Distance Function G
localK

Neighbourhood density function
rotate.ppp

Rotate a Point Pattern
rmhmodel.ppm

Interpret Fitted Model for Metropolis-Hastings Simulation.
duplicated.ppp

Determine Duplicated Points in a Spatial Point Pattern
ripras

Estimate window from points alone
crossdist.ppp

Pairwise distances between two different point patterns
Softcore

The Soft Core Point Process Model
rotate

Rotate
summary.ppp

Summary of a Point Pattern Dataset
subset.splitppp

Extract or Replace Sub-Patterns
suffstat

Sufficient Statistic of Point Process Model
affine.ppp

Apply Affine Transformation To Point Pattern
as.data.frame.psp

Coerce Line Segment Pattern to a Data Frame
with.fv

Evaluate an Expression in a Function Table
subset.im

Extract Subset of Image
rstrat

Simulate Stratified Random Point Pattern
Pairwise

Generic Pairwise Interaction model
matclust.estK

Fit the Matern Cluster Point Process by Minimum Contrast
runifpoint

Generate N Uniform Random Points
simdat

Simulated Point Pattern
ppp

Create a Point Pattern
rshift.splitppp

Randomly Shift a List of Point Patterns
Kmulti

Marked K-Function
Lest

L-function
shift.psp

Apply Vector Translation To Line Segment Pattern
subset.ppp

Extract or Replace Subset of Point Pattern
urkiola

Urkiola Woods Point Pattern
raster.x

Cartesian Coordinates for a Pixel Raster
quadscheme

Generate a Quadrature Scheme from a Point Pattern
shift.im

Apply Vector Translation To Pixel Image
rescale

Convert dataset to another unit of length
runifdisc

Generate N Uniform Random Points in a Disc
rStrauss

Perfect Simulation of the Strauss Process
solutionset

Evaluate Logical Expression Involving Pixel Images and Return Region Where Expression is True
superimpose

Superimpose Several Point Patterns
nearest.raster.point

Find Pixel Nearest to a Given Point
print.owin

Print Brief Details of a Spatial Window
rcell

Simulate Baddeley-Silverman Cell Process
rmpoint

Generate N Random Multitype Points
subset.fasp

Extract Subset of Function Array
lgcp.estK

Fit a Log-Gaussian Cox Point Process by Minimum Contrast
subset.listof

Extract or Replace Subset of a List of Things
murchison

Murchison gold deposits
rNeymanScott

Simulate Neyman-Scott Process
alltypes

Calculate Summary Statistic for All Types in a Multitype Point Pattern
plot.splitppp

Plot a List of Point Patterns
rpoint

Generate N Random Points
as.ppp

Convert Data To Class ppp
rMaternII

Simulate Matern Model II
print.ppm

Print a Fitted Point Process Model
humberside

Humberside Data on Childhood Leukaemia and Lymphoma
as.im

Convert to Pixel Image
rmh.ppm

Simulate from a Fitted Point Process Model
pointsOnLines

Place Points Evenly Along Specified Lines
predict.ppm

Prediction from a Fitted Point Process Model
[.tess

Extract or Replace Subset of Tessellation
runifpointOnLines

Generate N Uniform Random Points On Line Segments
update.kppm

Update a Fitted Cluster Point Process Model
shift.owin

Apply Vector Translation To Window
progressreport

Print Progress Reports
tiles

Extract List of Tiles in a Tessellation
centroid.owin

Centroid of a window
quad.ppm

Extract Quadrature Scheme Used to Fit a Point Process Model
pairwise.family

Pairwise Interaction Process Family
is.multitype

Test whether Object is Multitype
plot.owin

Plot a Spatial Window
smooth.ppp

Spatial smoothing of observations at irregular points
residualspaper

Data and Code From JRSS Discussion Paper on Residuals
lansing

Lansing Woods Point Pattern
rSSI

Simulate Simple Sequential Inhibition
unitname

Name for Unit of Length
owin.object

Class owin
shift.ppp

Apply Vector Translation To Point Pattern
split.im

Divide Image Into Sub-images
rmhmodel.list

Define Point Process Model for Metropolis-Hastings Simulation.
rmh

Simulate point patterns using the Metropolis-Hastings algorithm.
nearestsegment

Find Line Segment Nearest to Each Point
rlinegrid

Generate grid of parallel lines with random displacement
redwood

California Redwoods Point Pattern (Ripley's Subset)
blur

Apply Gaussian Blur to a Pixel Image
dummy.ppm

Extract Dummy Points Used to Fit a Point Process Model
nndist

Nearest neighbour distances
residuals.ppm

Residuals for Fitted Point Process Model
spokes

Spokes pattern of dummy points
pairsat.family

Saturated Pairwise Interaction Point Process Family
summary.owin

Summary of a Spatial Window
print.im

Print Brief Details of an Image
rshift.psp

Randomly Shift a Line Segment Pattern
print.quad

Print a Quadrature Scheme
eem

Exponential Energy Marks
lut

Lookup Tables
quadrats

Divide Region into Quadrats
quantile.im

Sample Quantiles of Pixel Image
plot.tess

Plot a tessellation
hyperframe

Hyper Data Frame
unmark

Remove Marks
plot.colourmap

Plot a Colour Map
unique.ppp

Extract Unique Points from a Spatial Point Pattern
setmarks

Set or Reset the Marks in a Point Pattern
subset.psp

Extract Subset of Line Segment Pattern
rshift

Random Shift
is.marked

Test Whether Marks Are Present
superimposePSP

Superimpose Several Line Segment Patterns
summary.listof

Summary of a List of Things
gpc2owin

Convert Polygonal Region into Different Format
vcov.ppm

Variance-Covariance Matrix for a Fitted Point Process Model
psp

Create a Line Segment Pattern
as.tess

Convert Data To Tessellation
simulate.kppm

Simulate a fitted cluster point process model.
spatstat.options

Internal Options in Spatstat Package
trim.rectangle

Cut margins from rectangle
print.ppp

Print Brief Details of a Point Pattern Dataset
rmh.default

Simulate Point Process Models using the Metropolis-Hastings Algorithm.
quad.object

Class of Quadrature Schemes
rmhmodel

Define Point Process Model for Metropolis-Hastings Simulation.
finpines

Pine saplings in Finland.
hist.im

Histogram of Pixel Values in an Image
StraussHard

The Strauss / Hard Core Point Process Model
nnwhich

Nearest neighbour
redwoodfull

California Redwoods Point Pattern (Entire Dataset)
compatible.im

Test Whether Two Pixel Images Are Compatible
letterR

Window in Shape of Letter R
quadratcount

Quadrat counting for a point pattern
OrdThresh

Ord's Interaction model
is.subset.owin

Determine Whether One Window is Contained In Another
pcf.fv

Pair Correlation Function obtained from K Function
rThomas

Simulate Thomas Process
append.psp

Combine Two Line Segment Patterns
crossdist.default

Pairwise distances between two different sets of points
Kmeasure

Reduced Second Moment Measure
quadratresample

Resample a Point Pattern by Resampling Quadrats
summary.quad

Summarizing a Quadrature Scheme
update.ppm

Update a Fitted Point Process Model
bounding.box

Bounding Box of a Window or Point Pattern
summary.splitppp

Summary of a Split Point Pattern
disc

Circular Window
ganglia

Beta Ganglion Cells in Cat Retina, Old Version
rMaternI

Simulate Matern Model I
bdist.pixels

Distance to Boundary of Window
mean.im

Mean, Median and Range of Pixel Values in an Image