Learn R Programming

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

spatstat (version 1.11-4)

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 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

14,637

Version

1.11-4

License

GPL version 2 or newer

Maintainer

Last Published

July 15th, 2024

Functions in spatstat (1.11-4)

anova.ppm

ANOVA for Fitted Point Process Models
area.owin

Area of a Window
Kest.fft

K-function using FFT
LennardJones

The Lennard-Jones Potential
markcorr

Mark Correlation Function
as.owin

Convert Data To Class owin
compatible.im

Test Whether Two Pixel Images Are Compatible
is.multitype.ppm

Test Whether A Point Process Model is Multitype
data.ppm

Extract Original Data from a Fitted Point Process Model
angles.psp

Orientation Angles of Line Segments
dilate.owin

Dilate a Window
copper

Berman-Huntington points and lines data
erode.owin

Erode a Window
append.psp

Combine Two Line Segment Patterns
km.rs

Kaplan-Meier and Reduced Sample Estimator using Histograms
MultiStrauss

The Multitype Strauss Point Process Model
Geyer

Geyer's Saturation Point Process Model
predict.ppm

Prediction from a Fitted Point Process Model
affine

Apply Affine Transformation
eval.fv

Evaluate Expression Involving Functions
cut.ppp

Convert Point Pattern Marks from Numeric to Factor
rmhmodel.default

Build Point Process Model for Metropolis-Hastings Simulation.
vcov.ppm

Variance-Covariance Matrix for a Fitted Point Process Model
subset.splitppp

Extract or Replace Sub-Patterns
nndist

Nearest neighbour distances
thomas.estK

Fit the Thomas Point Process by Minimum Contrast
Gcross

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

The Multitype/Hard Core Strauss Point Process Model
distmap.ppp

Distance Map of Point Pattern
Gmulti

Marked Nearest Neighbour Distance Function
hist.im

Histogram of Pixel Values in an Image
is.subset.owin

Determine Whether One Window is Contained In Another
plot.listof

Plot a List of Things
im

Create a Pixel Image Object
rstrat

Simulate Stratified Random Point Pattern
shift.im

Apply Vector Translation To Pixel Image
markstat

Summarise Marks in Every Neighbourhood in a Point Pattern
Fest

Estimate the empty space function F
density.ppp

Kernel Smoothed Intensity of Point Pattern
OrdThresh

Ord's Interaction model
plot.fasp

Plot a Function Array
plot.owin

Plot a Spatial Window
pairdist.ppp

Pairwise distances
suffstat

Sufficient Statistic of Point Process Model
raster.x

Cartesian Coordinates for a Pixel Raster
rmhmodel.ppm

Interpret Fitted Model for Metropolis-Hastings Simulation.
rsyst

Simulate systematic random point pattern
eroded.areas

Areas of Morphological Erosions
redwood

California Redwoods Point Pattern (Ripley's Subset)
is.marked.ppp

Test Whether A Point Pattern is Marked
density.splitppp

Kernel Smoothed Intensity of Split Point Pattern
mincontrast

Method of Minimum Contrast
spatstat-internal

Internal spatstat functions
clickpoly

Interactively Define a Polygon
Jmulti

Marked J Function
plot.plotppm

Plot a plotppm Object Created by plot.ppm
betacells

Beta Ganglion Cells in Cat Retina
nztrees

New Zealand Trees Point Pattern
gridweights

Compute Quadrature Weights Based on Grid Counts
dirichlet.weights

Compute Quadrature Weights Based on Dirichlet Tessellation
mean.im

Mean Pixel Value in an Image
is.multitype.ppp

Test Whether A Point Pattern is Multitype
lansing

Lansing Woods Point Pattern
Kmeasure

Reduced Second Moment Measure
ks.test.ppm

Kolmogorov-Smirnov Test for Point Process Model
Iest

Estimate the I-function
crossdist.default

Pairwise distances between two different sets of points
shift.owin

Apply Vector Translation To Window
centroid.owin

Centroid of a window
clickppp

Interactively Add Points
Kmulti

Marked K-Function
nncross

Nearest Neighbour in Another Point Pattern
bounding.box.xy

Convex Hull of Points
intersect.owin

Intersection or Union of Two Windows
bramblecanes

Hutchings' Bramble Canes data
nnwhich

Nearest neighbour
setmarks

Set or Reset the Marks in a Point Pattern
reach

Interaction Distance of a Point Process
simdat

Simulated Point Pattern
rmhstart

Determine Initial State for Metropolis-Hastings Simulation.
diagnose.ppm

Diagnostic Plots for Fitted Point Process Model
rmpoint

Generate N Random Multitype Points
summary.ppp

Summary of a Point Pattern Dataset
runifpoint

Generate N Uniform Random Points
pairdist

Pairwise distances
ants

Harkness-Isham ants' nests data
rotate.ppp

Rotate a Point Pattern
nncorr

Nearest-Neighbour Correlation of Marked Point Pattern
corners

Corners of a rectangle
diameter

Diameter of a Window
summary.ppm

Summarizing a Fitted Point Process Model
summary.listof

Summary of a List of Things
rshift

Random Shift
persp.im

Perspective Plot of Pixel Image
print.ppm

Print a Fitted Point Process Model
subsetget.im

Reset Values in Subset of Image
rshift.splitppp

Randomly Shift a List of Point Patterns
superimpose

Superimpose Several Point Patterns
residuals.ppm

Residuals for Fitted Point Process Model
selfcrossing.psp

Crossing Points in a Line Segment Pattern
rthin

Random Thinning
rStrauss

Perfect Simulation of the Strauss Process
quadratcount

Quadrat counting for a point pattern
plot.im

Plot a Pixel Image
rescale.ppp

Convert Point Pattern to Another Unit of Length
update.ppm

Update a Fitted Point Process Model
summary.quad

Summarizing a Quadrature Scheme
rcell

Simulate Baddeley-Silverman Cell Process
summary.owin

Summary of a Spatial Window
letterR

Window in Shape of Letter R
rescale

Convert dataset to another unit of length
Kdot.inhom

Inhomogeneous Multitype K Dot Function
Strauss

The Strauss Point Process Model
StraussHard

The Strauss / Hard Core Point Process Model
nbfires

Point Patterns of New Brunswick Forest Fires
fitin.ppm

Extract the Interaction from a Fitted Point Process Model
is.multitype

Test whether Object is Multitype
distmap.owin

Distance Map of Window
distmap

Distance Map
affine.psp

Apply Affine Transformation To Line Segment Pattern
plot.psp

plot a Spatial Line Segment Pattern
disc

Circular Window
unmark

Remove Marks from a Marked Point Pattern
duplicated.ppp

Determine Duplicated Points in a Spatial Point Pattern
psp

Create a Line Segment Pattern
bei

Tropical rain forest trees
applynbd

Apply Function to Every Neighbourhood in a Point Pattern
pairdist.default

Pairwise distances
compatible.fv

Test Whether Two Function Objects Are Compatible
affine.ppp

Apply Affine Transformation To Point Pattern
profilepl

Profile Maximum Pseudolikelihood
pairwise.family

Pairwise Interaction Process Family
quad.object

Class of Quadrature Schemes
ppp.object

Class of Point Patterns
spruces

Spruces Point Pattern
subset.fasp

Extract Subset of Function Array
psp.object

Class of Line Segment Patterns
hamster

Aherne's hamster tumour data
print.im

Print Brief Details of an Image
subset.listof

Extract or Replace Subset of a List of Things
midpoints.psp

Midpoints of Line Segment Pattern
ppm

Fit Point Process Model to Data
matclust.estK

Fit the Matern Cluster Point Process by Minimum Contrast
scanpp

Read Point Pattern From Data File
Kest

K-function
Jcross

Multitype J Function (i-to-j)
rNeymanScott

Simulate Neyman-Scott Process
as.im

Convert to Pixel Image
eval.im

Evaluate Expression Involving Pixel Images
lgcp.estK

Fit a Log-Gaussian Cox Point Process by Minimum Contrast
bdist.pixels

Distance to Boundary of Window
vertices

Vertices of a Window
solutionset

Evaluate Logical Expression Involving Pixel Images and Return Region Where Expression is True
rescale.owin

Convert Window to Another Unit of Length
subset.psp

Extract Subset of Line Segment Pattern
nearest.raster.point

Find Pixel Nearest to a Given Point
square

Square Window
subset.ppp

Extract or Replace Subset of Point Pattern
rpoisline

Generate Poisson Random Line Process
expand.owin

Expand Window By Factor
summary.psp

Summary of a Line Segment Pattern Dataset
redwoodfull

California Redwoods Point Pattern (Entire Dataset)
setcov

Set Covariance of a Window
DiggleGratton

Diggle-Gratton model
as.psp

Convert Data To Class psp
cells

Biological Cells Point Pattern
envelope

Simulation envelopes of summary function
alltypes

Calculate Statistic for All Types in a Multitype Point Pattern
shift.psp

Apply Vector Translation To Line Segment Pattern
Poisson

Poisson Point Process Model
spatstat-deprecated

Deprecated spatstat functions
finpines

Pine saplings in Finland.
is.marked

Test Whether Marks Are Present
rescale.psp

Convert Line Segment Pattern to Another Unit of Length
demopat

Artificial Data Point Pattern
rMaternII

Simulate Matern Model II
gridcentres

Rectangular grid of points
is.marked.ppm

Test Whether A Point Process Model is Marked
plot.ppp

plot a Spatial Point Pattern
reduced.sample

Reduced Sample Estimator using Histogram Data
plot.splitppp

Plot a List of Point Patterns
japanesepines

Japanese Pines Point Pattern
rotate.psp

Rotate a Line Segment Pattern
anemones

Beadlet Anemones Data
plot.quad

plot a Spatial Quadrature Scheme
rSSI

Simulate Simple Sequential Inhibition
dummy.ppm

Extract Dummy Points Used to Fit a Point Process Model
multiplicity.ppp

Count Multiplicity of Duplicate Points
amacrine

Hughes' Amacrine Cell Data
rotate.owin

Rotate a Window
ord.family

Ord Interaction Process Family
rpoispp

Generate Poisson Point Pattern
summary.splitppp

Summary of a Split Point Pattern
affine.owin

Apply Affine Transformation To Window
lengths.psp

Lengths of Line Segments
harmonic

Basis for Harmonic Functions
rshift.ppp

Randomly Shift a Point Pattern
Saturated

Saturated Pairwise Interaction model
kaplan.meier

Kaplan-Meier Estimator using Histogram Data
Ord

Generic Ord Interaction model
pcf

Pair Correlation Function
print.owin

Print Brief Details of a Spatial Window
owin

Create a Window
rshift.psp

Randomly Shift a Line Segment Pattern
ppm.object

Class of Fitted Point Process Models
print.psp

Print Brief Details of a Line Segment Pattern Dataset
ripras

Estimate window from points alone
rpoint

Generate N Random Points
runifdisc

Generate N Uniform Random Points in a Disc
subset.im

Extract Subset of Image
rmh.default

Simulate Point Process Models using the Metropolis-Hastings Algorithm.
density.psp

Kernel Smoothing of Line Segment Pattern
levelset

Level Set of a Pixel Image
bounding.box

Bounding Box of a Window or Point Pattern
ppp

Create a Point Pattern
ganglia

Beta Ganglion Cells in Cat Retina, Old Version
units

Name for Unit of Length
spokes

Spokes pattern of dummy points
crossdist.psp

Pairwise distances between two different line segment patterns
interp.im

Interpolate a Pixel Image
allstats

Calculate four standard summary functions of a point pattern.
pcf.fasp

Pair Correlation Function obtained from array of K functions
Jest

Estimate the J-function
crossing.psp

Crossing Points of Two Line Segment Patterns
coef.ppm

Coefficients of Fitted Point Process Model
Gdot

Multitype Nearest Neighbour Distance Function (i-to-any)
plot.fv

Plot Function Valuesn
Pairwise

Generic Pairwise Interaction model
lurking

Lurking variable plot
pairdist.psp

Pairwise distances between line segments
im.object

Class of Images
chorley

Chorley-Ribble Cancer Data
unique.ppp

Extract Unique Points from a Spatial Point Pattern
Kcross

Multitype K Function (Cross-type)
is.ppm

Test Whether An Object Is A Fitted Point Process Model
rmpoispp

Generate Multitype Poisson Point Pattern
qqplot.ppm

Q-Q Plot of Residuals from Fitted Point Process Model
spatstat.options

Internal Options in Spatstat Package
swedishpines

Swedish Pines Point Pattern
union.quad

Union of Data and Dummy Points
longleaf

Longleaf Pines Point Pattern
summary.im

Summarizing a Pixel Image
rMaternI

Simulate Matern Model I
shift.ppp

Apply Vector Translation To Point Pattern
PairPiece

The Piecewise Constant Pairwise Interaction Point Process Model
bdist.points

Distance to Boundary of Window
is.im

Test Whether An Object Is A Pixel Image
inside.owin

Test Whether Points Are Inside A Window
is.ppp

Test Whether An Object Is A Point Pattern
distmap.psp

Distance Map of Line Segment Pattern
complement.owin

Take Complement of a Window
endpoints.psp

Endpoints of Line Segment Pattern
crossdist.ppp

Pairwise distances between two different point patterns
humberside

Humberside Data on Childhood Leukaemia and Lymphoma
as.mask

Pixel Image Approximation of a Window
residualspaper

Data and Code From JRSS Discussion Paper on Residuals
pppdist

Optimal Match Between Two Point Patterns
rmh

Simulate point patterns using the Metropolis-Hastings algorithm.
rThomas

Simulate Thomas Process
Softcore

The Soft Core Point Process Model
spatstat

The Spatstat Package
Kinhom

Inhomogeneous K-function
Kcross.inhom

Inhomogeneous Cross K Function
ewcdf

Weighted Empirical Cumulative Distribution Function
as.ppp

Convert Data To Class ppp
fv.object

Data Frames of Function Values
eem

Exponential Energy Marks
Gest

Nearest Neighbour Distance Function G
crossdist

Pairwise distances
owin.object

Class owin
quantile.im

Sample Quantiles of Pixel Image
nndist.psp

Nearest neighbour distances between line segments
rmh.ppm

Simulate from a Fitted Point Process Model
rMatClust

Simulate Matern Cluster Process
convexhull.xy

Convex Hull of Points
pairsat.family

Saturated Pairwise Interaction Point Process Family
Jdot

Multitype J Function (i-to-any)
default.dummy

Generate a Default Pattern of Dummy Points
as.rectangle

Window Frame
contour.im

Contour plot of pixel image
fasp.object

Function Arrays for Spatial Patterns
Kdot

Multitype K Function (i-to-any)
is.owin

Test Whether An Object Is A Window
pcf.fv

Pair Correlation Function obtained from K Function
cut.im

Convert Pixel Image from Numeric to Factor
quadscheme

Generate a Quadrature Scheme from a Point Pattern
progressreport

Print Progress Reports
rescue.rectangle

Convert Window Back To Rectangle
rlabel

Random Re-Labelling of Point Pattern
subset.fv

Extract Subset of Function Values
rmhmodel.list

Define Point Process Model for Metropolis-Hastings Simulation.
trim.rectangle

Cut margins from rectangle
shift

Apply Vector Translation
pcf.ppp

Pair Correlation Function of Point Pattern
concatxy

Concatenate x,y Coordinate Vectors
as.matrix.im

Convert Pixel Image to Matrix
identify.ppp

Identify Points in a Point Pattern
print.quad

Print a Quadrature Scheme
quadrat.test

Chi-Squared Dispersion Test for Spatial Point Pattern Based on Quadrat Counts
plot.ppm

plot a Fitted Point Process Model
rmhmodel

Define Point Process Model for Metropolis-Hastings Simulation.
rotate

Rotate
fitted.ppm

Fitted Conditional Intensity for Point Process Model
split.ppp

Divide Point Pattern into Sub-patterns
quad.ppm

Extract Quadrature Scheme Used to Fit a Point Process Model
print.ppp

Print Brief Details of a Point Pattern Dataset
rmhcontrol

Set Control Parameters for Metropolis-Hastings Algorithm.