Learn R Programming

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

spatstat.geom (version 3.2-1)

Geometrical Functionality of the 'spatstat' Family

Description

Defines spatial data types and supports geometrical operations on them. Data types include point patterns, windows (domains), pixel images, line segment patterns, tessellations and hyperframes. Capabilities include creation and manipulation of data (using command line or graphical interaction), plotting, geometrical operations (rotation, shift, rescale, affine transformation), convex hull, discretisation and pixellation, Dirichlet tessellation, Delaunay triangulation, pairwise distances, nearest-neighbour distances, distance transform, morphological operations (erosion, dilation, closing, opening), quadrat counting, geometrical measurement, geometrical covariance, colour maps, calculus on spatial domains, Gaussian blur, level sets of images, transects of images, intersections between objects, minimum distance matching. (Excludes spatial data on a network, which are supported by the package 'spatstat.linnet'.)

Copy Link

Version

Install

install.packages('spatstat.geom')

Monthly Downloads

69,467

Version

3.2-1

License

GPL (>= 2)

Maintainer

Adrian Baddeley

Last Published

May 9th, 2023

Functions in spatstat.geom (3.2-1)

Extract.listof

Extract or Replace Subset of a List of Things
Extract.im

Extract Subset of Image
Extract.ppp

Extract or Replace Subset of Point Pattern
Extract.anylist

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

Extract Subset of Line Segment Pattern
Extract.ppx

Extract Subset of Multidimensional Point Pattern
Extract.hyperframe

Extract or Replace Subset of Hyperframe
Extract.owin

Extract Subset of Window
Math.im

S3 Group Generic methods for images
Extract.solist

Extract or Replace Subset of a List of Spatial Objects
Extract.splitppp

Extract or Replace Sub-Patterns
Window

Extract or Change the Window of a Spatial Object
Math.imlist

S3 Group Generic methods for List of Images
as.function.tess

Convert a Tessellation to a Function
as.hyperframe

Convert Data to Hyperframe
Extract.tess

Extract or Replace Subset of Tessellation
Frame

Extract or Change the Containing Rectangle of a Spatial Object
Extract.quad

Subset of Quadrature Scheme
Extract.layered

Extract or Replace Subset of a Layered Object
affine.im

Apply Affine Transformation To Pixel Image
Window.tess

Extract Window of Spatial Object
affine.owin

Apply Affine Transformation To Window
affine.ppp

Apply Affine Transformation To Point Pattern
add.texture

Fill Plot With Texture
affine

Apply Affine Transformation
as.boxx

Convert Data to Multi-Dimensional Box
as.colourmap

Convert to Colour Map
affine.psp

Apply Affine Transformation To Line Segment Pattern
affine.tess

Apply Geometrical Transformation To Tessellation
areaLoss

Difference of Disc Areas
MinkowskiSum

Minkowski Sum of Windows
angles.psp

Orientation Angles of Line Segments
as.matrix.im

Convert Pixel Image to Matrix or Array
append.psp

Combine Two Line Segment Patterns
Replace.im

Reset Values in Subset of Image
anyNA.im

Check Whether Image Contains NA Values
as.matrix.owin

Convert Pixel Image to Matrix
as.data.frame.psp

Coerce Line Segment Pattern to a Data Frame
applynbd

Apply Function to Every Neighbourhood in a Point Pattern
anylist

List of Objects
as.rectangle

Window Frame
as.box3

Convert Data to Three-Dimensional Box
as.tess

Convert Data To Tessellation
as.data.frame.hyperframe

Coerce Hyperframe to Data Frame
as.data.frame.tess

Convert Tessellation to Data Frame
area.owin

Area of a Window
bdist.pixels

Distance to Boundary of Window
as.hyperframe.ppx

Extract coordinates and marks of multidimensional point pattern
areaGain

Difference of Disc Areas
as.solist

Convert List of Two-Dimensional Spatial Objects
as.data.frame.im

Convert Pixel Image to Data Frame
as.function.im

Convert Pixel Image to Function of Coordinates
as.ppp

Convert Data To Class ppp
as.psp

Convert Data To Class psp
as.im

Convert to Pixel Image
as.function.owin

Convert Window to Indicator Function
cbind.hyperframe

Combine Hyperframes by Rows or by Columns
as.data.frame.owin

Convert Window to Data Frame
as.owin

Convert Data To Class owin
beachcolours

Create Colour Scheme for a Range of Numbers
boundingcircle

Smallest Enclosing Circle
as.polygonal

Convert a Window to a Polygonal Window
border

Border Region of a Window
box3

Three-Dimensional Box
as.layered

Convert Data To Layered Object
centroid.owin

Centroid of a window
boxx

Multi-Dimensional Box
as.mask

Pixel Image Approximation of a Window
by.im

Apply Function to Image Broken Down by Factor
clickppp

Interactively Add Points
by.ppp

Apply a Function to a Point Pattern Broken Down by Factor
colourtools

Convert and Compare Colours in Different Formats
bdist.points

Distance to Boundary of Window
commonGrid

Determine A Common Spatial Domain And Pixel Resolution
as.data.frame.ppp

Coerce Point Pattern to a Data Frame
bdist.tiles

Distance to Boundary of Window
chop.tess

Subdivide a Window or Tessellation using a Set of Lines
complement.owin

Take Complement of a Window
clickbox

Interactively Define a Rectangle
bounding.box.xy

Convex Hull of Points
concatxy

Concatenate x,y Coordinate Vectors
clip.infline

Intersect Infinite Straight Lines with a Window
connected.tess

Connected Components of Tiles of a Tessellation
boundingbox

Bounding Box of a Window, Image, or Point Pattern
covering

Cover Region with Discs
crossdist

Pairwise distances
closepairs

Close Pairs of Points
cut.im

Convert Pixel Image from Numeric to Factor
bufftess

Buffer Distance Tessellation
closepairs.pp3

Close Pairs of Points in 3 Dimensions
contour.imlist

Array of Contour Plots
clickdist

Interactively Measure Distance
contour.im

Contour plot of pixel image
colourmap

Colour Lookup Tables
convexhull.xy

Convex Hull of Points
colouroutputs

Extract or Assign Colour Values in a Colour Map
cut.ppp

Classify Points in a Point Pattern
clickpoly

Interactively Define a Polygon
crossdist.default

Pairwise distances between two different sets of points
convexhull

Convex Hull
convexmetric

Distance Metric Defined by Convex Set
convexify

Weil's Convexifying Operation
convolve.im

Convolution of Pixel Images
closetriples

Close Triples of Points
delaunayDistance

Distance on Delaunay Triangulation
compatible

Test Whether Objects Are Compatible
closing

Morphological Closing
compatible.im

Test Whether Pixel Images Are Compatible
connected

Connected components
dirichletVertices

Vertices and Edges of Dirichlet Tessellation
crossdist.pp3

Pairwise distances between two different three-dimensional point patterns
default.dummy

Generate a Default Pattern of Dummy Points
deltametric

Delta Metric
diameter.boxx

Geometrical Calculations for Multi-Dimensional Box
crossdist.ppp

Pairwise distances between two different point patterns
delaunay

Delaunay Triangulation of Point Pattern
dirichlet

Dirichlet Tessellation of Point Pattern
connected.ppp

Connected Components of a Point Pattern
edges2triangles

List Triangles in a Graph
crossdist.ppx

Pairwise Distances Between Two Different Multi-Dimensional Point Patterns
edges2vees

List Dihedral Triples in a Graph
coords

Extract or Change Coordinates of a Spatial or Spatiotemporal Point Pattern
dirichletAreas

Compute Areas of Tiles in Dirichlet Tessellation
diameter.owin

Diameter of a Window
dirichletWeights

Compute Quadrature Weights Based on Dirichlet Tessellation
diameter

Diameter of an Object
diameter.box3

Geometrical Calculations for Three-Dimensional Box
distfun

Distance Map as a Function
distmap

Distance Map
fourierbasis

Fourier Basis Functions
distmap.psp

Distance Map of Line Segment Pattern
corners

Corners of a rectangle
domain

Extract the Domain of any Spatial Object
distmap.owin

Distance Map of Window
ellipse

Elliptical Window.
discretise

Safely Convert Point Pattern Window to Binary Mask
edit.hyperframe

Invoke Text Editor on Hyperframe
discs

Union of Discs
distmap.ppp

Distance Map of Point Pattern
crossdist.psp

Pairwise distances between two different line segment patterns
duplicated.ppp

Determine Duplicated Points in a Spatial Point Pattern
edges

Extract Boundary Edges of a Window.
gridweights

Compute Quadrature Weights Based on Grid Counts
crossing.psp

Crossing Points of Two Line Segment Patterns
edit.ppp

Invoke Text Editor on Spatial Data
funxy

Spatial Function Class
endpoints.psp

Endpoints of Line Segment Pattern
dilated.areas

Areas of Morphological Dilations
dilation

Morphological Dilation
erosionAny

Morphological Erosion of Windows
eval.im

Evaluate Expression Involving Pixel Images
harmoniseLevels

Harmonise the levels of several factors, or factor-valued pixel images.
framedist.pixels

Distance to Bounding Frame
gridcentres

Rectangular grid of points
disc

Circular Window
headtail

First or Last Part of a Spatial Pattern
has.close

Check Whether Points Have Close Neighbours
grow.boxx

Add margins to box in any dimension
discpartarea

Area of Part of Disc
hextess

Hexagonal Grid or Tessellation
im

Create a Pixel Image Object
hist.funxy

Histogram of Values of a Spatial Function
eroded.areas

Areas of Morphological Erosions
im.object

Class of Images
erosion

Morphological Erosion by a Disc
im.apply

Apply Function Pixelwise to List of Images
hist.im

Histogram of Pixel Values in an Image
fardist

Farthest Distance to Boundary of Window
integral.density

Compute Integral of One-Dimensional Kernel Density Estimate.
invoke.metric

Perform Geometric Task using a Specified Metric
incircle

Find Largest Circle Inside Window
flipxy

Exchange X and Y Coordinates
infline

Infinite Straight Lines
intersect.owin

Intersection, Union or Set Subtraction of Windows
imcov

Spatial Covariance of a Pixel Image
intersect.tess

Intersection of Two Tessellations
invoke.symbolmap

Plot Data Using Graphics Symbol Map
harmonise.im

Make Pixel Images Compatible
ewcdf

Weighted Empirical Cumulative Distribution Function
is.linim

Test Whether an Object is a Pixel Image on a Linear Network
extrapolate.psp

Extrapolate Line Segments to Obtain Infinite Lines
intensity

Intensity of a Dataset or a Model
grow.rectangle

Add margins to rectangle
is.linnet

Test Whether An Object Is A Linear Network
harmonise

Make Objects Compatible
is.lpp

Test Whether An Object Is A Point Pattern on a Linear Network
integral.im

Integral of a Pixel Image
is.marked

Test Whether Marks Are Present
harmonise.owin

Make Windows Compatible
hotrod

Heat Kernel for a One-Dimensional Rod
hyperframe

Hyper Data Frame
intensity.ppp

Empirical Intensity of Point Pattern
intensity.ppx

Intensity of a Multidimensional Space-Time Point Pattern
identify.ppp

Identify Points in a Point Pattern
intensity.psp

Empirical Intensity of Line Segment Pattern
is.subset.owin

Determine Whether One Window is Contained In Another
layered

Create List of Plotting Layers
identify.psp

Identify Segments in a Line Segment Pattern
is.ppp

Test Whether An Object Is A Point Pattern
inside.boxx

Test Whether Points Are Inside A Multidimensional Box
interp.im

Interpolate a Pixel Image
is.rectangle

Determine Type of Window
is.boxx

Recognise a Multi-Dimensional Box
is.multitype.ppp

Test Whether A Point Pattern is Multitype
is.connected

Determine Whether an Object is Connected
intersect.boxx

Intersection Of Boxes Of Arbitrary Dimension
inside.owin

Test Whether Points Are Inside A Window
is.marked.ppp

Test Whether A Point Pattern is Marked
intensity.quadratcount

Intensity Estimates Using Quadrat Counts
is.empty

Test Whether An Object Is Empty
maxnndist

Compute Minimum or Maximum Nearest-Neighbour Distance
mean.ewcdf

Mean of Empirical Cumulative Distribution Function
is.im

Test Whether An Object Is A Pixel Image
interp.colourmap

Interpolate smoothly between specified colours
lengths_psp

Lengths of Line Segments
levelset

Level Set of a Pixel Image
markstat

Summarise Marks in Every Neighbourhood in a Point Pattern
lut

Lookup Tables
methods.distfun

Geometrical Operations for Distance Functions
marks

Marks of a Point Pattern
is.owin

Test Whether An Object Is A Window
is.multitype

Test whether Object is Multitype
matchingdist

Distance for a Point Pattern Matching
nearestValue

Image of Nearest Defined Pixel Value
nearestsegment

Find Line Segment Nearest to Each Point
nobjects

Count Number of Geometrical Objects in a Spatial Dataset
marks.psp

Marks of a Line Segment Pattern
npoints

Number of Points in a Point Pattern
methods.funxy

Methods for Spatial Functions
nndist.ppx

Nearest Neighbour Distances in Any Dimensions
padimage

Pad the Border of a Pixel Image
metric.object

Distance Metric
midpoints.psp

Midpoints of Line Segment Pattern
mean.im

Mean and Median of Pixel Values in an Image
marks.tess

Marks of a Tessellation
pairdist

Pairwise distances
nndist.psp

Nearest neighbour distances between line segments
methods.box3

Methods for Three-Dimensional Box
methods.boxx

Methods for Multi-Dimensional Box
pairdist.ppp

Pairwise distances
nndist

Nearest neighbour distances
mergeLevels

Merge Levels of a Factor
nestsplit

Nested Split
methods.layered

Methods for Layered Objects
nncross

Nearest Neighbours Between Two Patterns
is.connected.ppp

Determine Whether a Point Pattern is Connected
is.convex

Test Whether a Window is Convex
methods.pp3

Methods for three-dimensional point patterns
layerplotargs

Extract or Replace the Plot Arguments of a Layered Object
layout.boxes

Generate a Row or Column Arrangement of Rectangles.
methods.ppx

Methods for Multidimensional Space-Time Point Patterns
nnfun

Nearest Neighbour Index Map as a Function
multiplicity.ppp

Count Multiplicity of Duplicate Points
nearest.raster.point

Find Pixel Nearest to a Given Point
methods.unitname

Methods for Units
nncross.pp3

Nearest Neighbours Between Two Patterns in 3D
pixellate

Convert Spatial Object to Pixel Image
pHcolourmap

Colour Map for pH Values
owin2mask

Convert Window to Binary Mask under Constraints
nnmap

K-th Nearest Point Map
perspPoints

Draw Points or Lines on a Surface Viewed in Perspective
nnwhich.pp3

Nearest neighbours in three dimensions
pixellate.owin

Convert Window to Pixel Image
nnwhich.ppx

Nearest Neighbours in Any Dimensions
plot.quad

Plot a Spatial Quadrature Scheme
pixelcentres

Extract Pixel Centres as Point Pattern
nndist.pp3

Nearest neighbour distances in three dimensions
nsegments

Number of Line Segments in a Line Segment Pattern
nvertices

Count Number of Vertices
nncross.ppx

Nearest Neighbours Between Two Patterns in Any Dimensions
periodify

Make Periodic Copies of a Spatial Pattern
plot.quadratcount

Plot Quadrat Counts
pixellate.ppp

Convert Point Pattern to Pixel Image
psp.object

Class of Line Segment Patterns
persp.im

Perspective Plot of Pixel Image
regularpolygon

Create A Regular Polygon
pairdist.ppx

Pairwise Distances in Any Dimensions
ppx

Multidimensional Space-Time Point Pattern
pppmatching.object

Class of Point Matchings
reflect

Reflect In Origin
selfcrossing.psp

Crossing Points in a Line Segment Pattern
quantess

Quantile Tessellation
rotate.infline

Rotate or Shift Infinite Lines
psp

Create a Line Segment Pattern
rotate.owin

Rotate a Window
quantile.ewcdf

Quantiles of Weighted Empirical Cumulative Distribution Function
selfcut.psp

Cut Line Segments Where They Intersect
nnmark

Mark of Nearest Neighbour
pairdist.default

Pairwise distances
spatdim

Spatial Dimension of a Dataset
nnwhich

Nearest neighbour
opening

Morphological Opening
pixellate.psp

Convert Line Segment Pattern to Pixel Image
pixelquad

Quadrature Scheme Based on Pixel Grid
plot.anylist

Plot a List of Things
plot.pppmatching

Plot a Point Matching
spatstat.geom-deprecated

Deprecated spatstat.geom functions
square

Square Window
plot.psp

plot a Spatial Line Segment Pattern
stratrand

Stratified random point pattern
subset.psp

Subset of Line Segment Satisfying A Condition
plot.symbolmap

Plot a Graphics Symbol Map
overlap.owin

Compute Area of Overlap
owin

Create a Window
summary.anylist

Summary of a List of Things
test.crossing.psp

Check Whether Segments Cross
plot.tess

Plot a Tessellation
text.ppp

Add Text Labels to Spatial Pattern
pairdist.pp3

Pairwise distances in Three Dimensions
plot.pp3

Plot a Three-Dimensional Point Pattern
plot.ppp

plot a Spatial Point Pattern
plot.onearrow

Plot an Arrow
tiles

Extract List of Tiles in a Tessellation
plot.yardstick

Plot a Yardstick or Scale Bar
tilenames

Names of Tiles in a Tessellation
owin.object

Class owin
plot.owin

Plot a Spatial Window
plot.textstring

Plot a Text String
plot.im

Plot a Pixel Image
pairdist.psp

Pairwise distances between line segments
update.symbolmap

Update a Graphics Symbol Map.
plot.imlist

Plot a List of Images
pointsOnLines

Place Points Evenly Along Specified Lines
ppp

Create a Point Pattern
plot.texturemap

Plot a Texture Map
plot.layered

Layered Plot
unstack.solist

Unstack Each Spatial Object in a List of Objects
perimeter

Perimeter Length of Window
plot.colourmap

Plot a Colour Map
ppp.object

Class of Point Patterns
plot.listof

Plot a List of Things
where.max

Find Location of Maximum in a Pixel Image
polartess

Tessellation Using Polar Coordinates
pp3

Three Dimensional Point Pattern
plot.hyperframe

Plot Entries in a Hyperframe
print.im

Print Brief Details of an Image
print.quad

Print a Quadrature Scheme
quadratcount

Quadrat counting for a point pattern
whichhalfplane

Test Which Side of Infinite Line a Point Falls On
print.ppp

Print Brief Details of a Point Pattern Dataset
print.psp

Print Brief Details of a Line Segment Pattern Dataset
quadrats

Divide Region into Quadrats
psp2mask

Convert Line Segment Pattern to Binary Pixel Mask
quad.object

Class of Quadrature Schemes
print.owin

Print Brief Details of a Spatial Window
raster.x

Cartesian Coordinates for a Pixel Raster
plot.solist

Plot a List of Spatial Objects
rectdistmap

Distance Map Using Rectangular Distance Metric
relevel.im

Reorder Levels of a Factor-Valued Image or Pattern
plot.splitppp

Plot a List of Point Patterns
quasirandom

Quasirandom Patterns
rQuasi

Generate Quasirandom Point Pattern in Given Window
quadscheme

Generate a Quadrature Scheme from a Point Pattern
quadscheme.logi

Generate a Logistic Regression Quadrature Scheme from a Point Pattern
pppdist

Distance Between Two Point Patterns
progressreport

Print Progress Reports
requireversion

Require a Specific Version of a Package
pppmatching

Create a Point Matching
rescale.owin

Convert Window to Another Unit of Length
rescale.ppp

Convert Point Pattern to Another Unit of Length
runifrect

Generate N Uniform Random Points in a Rectangle
scalardilate

Apply Scalar Dilation
restrict.colourmap

Restrict a Colour Map to a Subset of Values
project2segment

Move Point To Nearest Line
shift

Apply Vector Translation
rgbim

Create Colour-Valued Pixel Image
rescale

Convert dataset to another unit of length
rexplode

Explode a Point Pattern by Displacing Duplicated Points
shift.im

Apply Vector Translation To Pixel Image
project2set

Find Nearest Point in a Region
quantile.im

Sample Quantiles of Pixel Image
rescale.im

Convert Pixel Image to Another Unit of Length
sidelengths.owin

Side Lengths of Enclosing Rectangle of a Window
quantilefun

Quantile Function
round.ppp

Apply Numerical Rounding to Spatial Coordinates
ripras

Estimate window from points alone
rounding

Detect Numerical Rounding
rescale.psp

Convert Line Segment Pattern to Another Unit of Length
rescue.rectangle

Convert Window Back To Rectangle
rsyst

Simulate systematic random point pattern
rjitter

Random Perturbation of a Point Pattern
rlinegrid

Generate grid of parallel lines with random displacement
simplepanel

Simple Point-and-Click Interface Panels
scaletointerval

Rescale Data to Lie Between Specified Limits
scanpp

Read Point Pattern From Data File
rotate

Rotate
split.im

Divide Image Into Sub-images
split.ppp

Divide Point Pattern into Sub-patterns
sessionLibs

Print Names and Version Numbers of Libraries Loaded
run.simplepanel

Run Point-and-Click Interface
rotate.im

Rotate a Pixel Image
spatstat.geom-internal

Internal spatstat.geom functions
rotate.ppp

Rotate a Point Pattern
shift.ppx

Apply Vector Translation To Box Or Point Pattern In Arbitrary Dimension
setcov

Set Covariance of a Window
rotate.psp

Rotate a Line Segment Pattern
spatstat.geom-package

The spatstat.geom Package
solist

List of Two-Dimensional Spatial Objects
shift.owin

Apply Vector Translation To Window
shift.ppp

Apply Vector Translation To Point Pattern
summary.splitppp

Summary of a Split Point Pattern
superimpose

Superimpose Several Geometric Patterns
shift.psp

Apply Vector Translation To Line Segment Pattern
subset.hyperframe

Subset of Hyperframe Satisfying A Condition
tiles.empty

Check For Empty Tiles in a Tessellation
simplify.owin

Approximate a Polygon by a Simpler Polygon
timeTaken

Extract the Total Computation Time
solutionset

Evaluate Logical Expression Involving Pixel Images and Return Region Where Expression is True
subset.ppp

Subset of Point Pattern Satisfying A Condition
split.ppx

Divide Multidimensional Point Pattern into Sub-patterns
solapply

Apply a Function Over a List and Obtain a List of Objects
summary.owin

Summary of a Spatial Window
summary.distfun

Summarizing a Function of Spatial Location
spatstat.options

Internal Options in Spatstat Package
uniquemap.default

Map Duplicate Entries to Unique Entries
summary.listof

Summary of a List of Things
split.hyperframe

Divide Hyperframe Into Subsets and Reassemble
unitname

Name for Unit of Length
spokes

Spokes pattern of dummy points
summary.quad

Summarizing a Quadrature Scheme
summary.solist

Summary of a List of Spatial Objects
trim.rectangle

Cut margins from rectangle
summary.ppp

Summary of a Point Pattern Dataset
tile.areas

Compute Areas of Tiles in a Tessellation
tileindex

Determine Which Tile Contains Each Given Point
timed

Record the Computation Time
uniquemap.ppp

Map Duplicate Entries to Unique Entries
yardstick

Text, Arrow or Scale Bar in a Diagram
summary.im

Summarizing a Pixel Image
zapsmall.im

Rounding of Pixel Values
transformquantiles

Transform the Quantiles
tweak.colourmap

Change Colour Values in a Colour Map
unmark

Remove Marks
summary.psp

Summary of a Line Segment Pattern Dataset
symbolmap

Graphics Symbol Map
texturemap

Texture Map
union.quad

Union of Data and Dummy Points
unique.ppp

Extract Unique Points from a Spatial Point Pattern
tess

Create a Tessellation
transmat

Convert Pixel Array Between Different Conventions
triangulate.owin

Decompose Window into Triangles
unnormdensity

Weighted kernel smoother
textureplot

Plot Image or Tessellation Using Texture Fill
venn.tess

Tessellation Delimited by Several Sets
vertices

Vertices of a Window
unstack.ppp

Separate Multiple Columns of Marks
with.hyperframe

Evaluate an Expression in Each Row of a Hyperframe
whist

Weighted Histogram
weighted.median

Weighted Median, Quantiles or Variance
volume

Volume of an Object