Learn R Programming

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

spatstat.geom (version 3.2-4)

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

64,669

Version

3.2-4

License

GPL (>= 2)

Maintainer

Adrian Baddeley

Last Published

July 20th, 2023

Functions in spatstat.geom (3.2-4)

Extract.listof

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

Extract Subset of Line Segment Pattern
Extract.ppp

Extract or Replace Subset of Point Pattern
Extract.hyperframe

Extract or Replace Subset of Hyperframe
Extract.im

Extract Subset of Image
Extract.ppx

Extract Subset of Multidimensional Point Pattern
Extract.layered

Extract or Replace Subset of a Layered Object
Extract.owin

Extract Subset of Window
Extract.anylist

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

Subset of Quadrature Scheme
MinkowskiSum

Minkowski Sum of Windows
Math.imlist

S3 Group Generic methods for List of Images
Extract.splitppp

Extract or Replace Sub-Patterns
Extract.tess

Extract or Replace Subset of Tessellation
Window.tess

Extract Window of Spatial Object
Replace.im

Reset Values in Subset of Image
Frame

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

Extract or Replace Subset of a List of Spatial Objects
Window

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

S3 Group Generic methods for images
affine.tess

Apply Geometrical Transformation To Tessellation
anyNA.im

Check Whether Image Contains NA Values
add.texture

Fill Plot With Texture
anylist

List of Objects
affine

Apply Affine Transformation
affine.im

Apply Affine Transformation To Pixel Image
angles.psp

Orientation Angles of Line Segments
affine.owin

Apply Affine Transformation To Window
append.psp

Combine Two Line Segment Patterns
areaLoss

Difference of Disc Areas
affine.ppp

Apply Affine Transformation To Point Pattern
as.boxx

Convert Data to Multi-Dimensional Box
applynbd

Apply Function to Every Neighbourhood in a Point Pattern
as.colourmap

Convert to Colour Map
as.data.frame.hyperframe

Coerce Hyperframe to Data Frame
as.matrix.im

Convert Pixel Image to Matrix or Array
as.data.frame.im

Convert Pixel Image to Data Frame
affine.psp

Apply Affine Transformation To Line Segment Pattern
as.data.frame.owin

Convert Window to Data Frame
as.box3

Convert Data to Three-Dimensional Box
as.data.frame.ppp

Coerce Point Pattern to a Data Frame
as.data.frame.psp

Coerce Line Segment Pattern to a Data Frame
area.owin

Area of a Window
as.data.frame.tess

Convert Tessellation to Data Frame
as.matrix.owin

Convert Pixel Image to Matrix
as.rectangle

Window Frame
areaGain

Difference of Disc Areas
as.layered

Convert Data To Layered Object
as.function.im

Convert Pixel Image to Function of Coordinates
as.function.tess

Convert a Tessellation to a Function
as.solist

Convert List of Two-Dimensional Spatial Objects
boundingcircle

Smallest Enclosing Circle
beachcolours

Create Colour Scheme for a Range of Numbers
as.hyperframe

Convert Data to Hyperframe
border

Border Region of a Window
as.mask

Pixel Image Approximation of a Window
box3

Three-Dimensional Box
as.ppp

Convert Data To Class ppp
chop.tess

Subdivide a Window or Tessellation using a Set of Lines
as.hyperframe.ppx

Extract coordinates and marks of multidimensional point pattern
clickbox

Interactively Define a Rectangle
bdist.points

Distance to Boundary of Window
as.function.owin

Convert Window to Indicator Function
clickdist

Interactively Measure Distance
bounding.box.xy

Convex Hull of Points
as.psp

Convert Data To Class psp
boundingbox

Bounding Box of a Window, Image, or Point Pattern
cbind.hyperframe

Combine Hyperframes by Rows or by Columns
bdist.tiles

Distance to Boundary of Window
by.im

Apply Function to Image Broken Down by Factor
by.ppp

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

Interactively Define a Polygon
closepairs

Close Pairs of Points
connected.tess

Connected Components of Tiles of a Tessellation
closepairs.pp3

Close Pairs of Points in 3 Dimensions
contour.im

Contour plot of pixel image
complement.owin

Take Complement of a Window
centroid.owin

Centroid of a window
colourtools

Convert and Compare Colours in Different Formats
as.im

Convert to Pixel Image
crossdist.default

Pairwise distances between two different sets of points
closetriples

Close Triples of Points
closing

Morphological Closing
clickppp

Interactively Add Points
concatxy

Concatenate x,y Coordinate Vectors
convexmetric

Distance Metric Defined by Convex Set
connected

Connected components
as.owin

Convert Data To Class owin
as.polygonal

Convert a Window to a Polygonal Window
clip.infline

Intersect Infinite Straight Lines with a Window
as.tess

Convert Data To Tessellation
crossdist.pp3

Pairwise distances between two different three-dimensional point patterns
connected.ppp

Connected Components of a Point Pattern
contour.imlist

Array of Contour Plots
convexhull

Convex Hull
bdist.pixels

Distance to Boundary of Window
cut.im

Convert Pixel Image from Numeric to Factor
commonGrid

Determine A Common Spatial Domain And Pixel Resolution
convexhull.xy

Convex Hull of Points
compatible

Test Whether Objects Are Compatible
crossdist.ppp

Pairwise distances between two different point patterns
convolve.im

Convolution of Pixel Images
cut.ppp

Classify Points in a Point Pattern
crossdist.ppx

Pairwise Distances Between Two Different Multi-Dimensional Point Patterns
convexify

Weil's Convexifying Operation
boxx

Multi-Dimensional Box
bufftess

Buffer Distance Tessellation
crossdist.psp

Pairwise distances between two different line segment patterns
colourmap

Colour Lookup Tables
crossing.psp

Crossing Points of Two Line Segment Patterns
edit.hyperframe

Invoke Text Editor on Hyperframe
dirichlet

Dirichlet Tessellation of Point Pattern
colouroutputs

Extract or Assign Colour Values in a Colour Map
dilated.areas

Areas of Morphological Dilations
dirichletAreas

Compute Areas of Tiles in Dirichlet Tessellation
coords

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

Distance on Delaunay Triangulation
edit.ppp

Invoke Text Editor on Spatial Data
corners

Corners of a rectangle
ewcdf

Weighted Empirical Cumulative Distribution Function
extrapolate.psp

Extrapolate Line Segments to Obtain Infinite Lines
diameter

Diameter of an Object
grow.rectangle

Add margins to rectangle
dilation

Morphological Dilation
distmap.psp

Distance Map of Line Segment Pattern
deltametric

Delta Metric
distfun

Distance Map as a Function
domain

Extract the Domain of any Spatial Object
ellipse

Elliptical Window.
diameter.box3

Geometrical Calculations for Three-Dimensional Box
harmonise

Make Objects Compatible
hotrod

Heat Kernel for a One-Dimensional Rod
distmap.owin

Distance Map of Window
diameter.boxx

Geometrical Calculations for Multi-Dimensional Box
compatible.im

Test Whether Pixel Images Are Compatible
covering

Cover Region with Discs
diameter.owin

Diameter of a Window
distmap.ppp

Distance Map of Point Pattern
hyperframe

Hyper Data Frame
crossdist

Pairwise distances
endpoints.psp

Endpoints of Line Segment Pattern
intersect.owin

Intersection, Union or Set Subtraction of Windows
default.dummy

Generate a Default Pattern of Dummy Points
discretise

Safely Convert Point Pattern Window to Binary Mask
distmap

Distance Map
intersect.tess

Intersection of Two Tessellations
hist.funxy

Histogram of Values of a Spatial Function
hist.im

Histogram of Pixel Values in an Image
is.empty

Test Whether An Object Is Empty
duplicated.ppp

Determine Duplicated Points in a Spatial Point Pattern
discs

Union of Discs
intensity.ppx

Intensity of a Multidimensional Space-Time Point Pattern
intensity.psp

Empirical Intensity of Line Segment Pattern
edges2triangles

List Triangles in a Graph
is.boxx

Recognise a Multi-Dimensional Box
delaunay

Delaunay Triangulation of Point Pattern
is.connected

Determine Whether an Object is Connected
is.im

Test Whether An Object Is A Pixel Image
eroded.areas

Areas of Morphological Erosions
dirichletVertices

Vertices and Edges of Dirichlet Tessellation
is.lpp

Test Whether An Object Is A Point Pattern on a Linear Network
dirichletWeights

Compute Quadrature Weights Based on Dirichlet Tessellation
edges2vees

List Dihedral Triples in a Graph
is.marked

Test Whether Marks Are Present
edges

Extract Boundary Edges of a Window.
is.subset.owin

Determine Whether One Window is Contained In Another
funxy

Spatial Function Class
fourierbasis

Fourier Basis Functions
erosion

Morphological Erosion by a Disc
gridcentres

Rectangular grid of points
layered

Create List of Plotting Layers
disc

Circular Window
framedist.pixels

Distance to Bounding Frame
layerplotargs

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

Generate a Row or Column Arrangement of Rectangles.
erosionAny

Morphological Erosion of Windows
headtail

First or Last Part of a Spatial Pattern
markstat

Summarise Marks in Every Neighbourhood in a Point Pattern
matchingdist

Distance for a Point Pattern Matching
gridweights

Compute Quadrature Weights Based on Grid Counts
hextess

Hexagonal Grid or Tessellation
eval.im

Evaluate Expression Involving Pixel Images
harmoniseLevels

Harmonise the levels of several factors, or factor-valued pixel images.
identify.ppp

Identify Points in a Point Pattern
grow.boxx

Add margins to box in any dimension
has.close

Check Whether Points Have Close Neighbours
im

Create a Pixel Image Object
discpartarea

Area of Part of Disc
im.apply

Apply Function Pixelwise to List of Images
nestsplit

Nested Split
lut

Lookup Tables
nncross

Nearest Neighbours Between Two Patterns
incircle

Find Largest Circle Inside Window
marks

Marks of a Point Pattern
intensity

Intensity of a Dataset or a Model
methods.layered

Methods for Layered Objects
infline

Infinite Straight Lines
lengths_psp

Lengths of Line Segments
fardist

Farthest Distance to Boundary of Window
methods.pp3

Methods for three-dimensional point patterns
nobjects

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

Identify Segments in a Line Segment Pattern
levelset

Level Set of a Pixel Image
multiplicity.ppp

Count Multiplicity of Duplicate Points
marks.psp

Marks of a Line Segment Pattern
marks.tess

Marks of a Tessellation
methods.ppx

Methods for Multidimensional Space-Time Point Patterns
flipxy

Exchange X and Y Coordinates
harmonise.im

Make Pixel Images Compatible
npoints

Number of Points in a Point Pattern
integral.density

Compute Integral of One-Dimensional Kernel Density Estimate.
integral.im

Integral of a Pixel Image
interp.im

Interpolate a Pixel Image
intensity.ppp

Empirical Intensity of Point Pattern
harmonise.owin

Make Windows Compatible
intensity.quadratcount

Intensity Estimates Using Quadrat Counts
methods.unitname

Methods for Units
intersect.boxx

Intersection Of Boxes Of Arbitrary Dimension
is.marked.ppp

Test Whether A Point Pattern is Marked
pairdist.ppp

Pairwise distances
nndist

Nearest neighbour distances
is.multitype

Test whether Object is Multitype
interp.colourmap

Interpolate smoothly between specified colours
is.connected.ppp

Determine Whether a Point Pattern is Connected
nndist.pp3

Nearest neighbour distances in three dimensions
maxnndist

Compute Minimum or Maximum Nearest-Neighbour Distance
nearest.raster.point

Find Pixel Nearest to a Given Point
pairdist.ppx

Pairwise Distances in Any Dimensions
is.convex

Test Whether a Window is Convex
pixellate

Convert Spatial Object to Pixel Image
nsegments

Number of Line Segments in a Line Segment Pattern
nvertices

Count Number of Vertices
pixellate.owin

Convert Window to Pixel Image
is.multitype.ppp

Test Whether A Point Pattern is Multitype
periodify

Make Periodic Copies of a Spatial Pattern
im.object

Class of Images
imcov

Spatial Covariance of a Pixel Image
plot.quad

Plot a Spatial Quadrature Scheme
mean.ewcdf

Mean of Empirical Cumulative Distribution Function
inside.boxx

Test Whether Points Are Inside A Multidimensional Box
persp.im

Perspective Plot of Pixel Image
metric.object

Distance Metric
nndist.ppx

Nearest Neighbour Distances in Any Dimensions
nndist.psp

Nearest neighbour distances between line segments
plot.colourmap

Plot a Colour Map
is.owin

Test Whether An Object Is A Window
inside.owin

Test Whether Points Are Inside A Window
mean.im

Mean and Median of Pixel Values in an Image
invoke.metric

Perform Geometric Task using a Specified Metric
padimage

Pad the Border of a Pixel Image
mergeLevels

Merge Levels of a Factor
pairdist

Pairwise distances
plot.quadratcount

Plot Quadrat Counts
invoke.symbolmap

Plot Data Using Graphics Symbol Map
is.linim

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

Test Whether An Object Is A Linear Network
plot.hyperframe

Plot Entries in a Hyperframe
pairdist.psp

Pairwise distances between line segments
methods.box3

Methods for Three-Dimensional Box
plot.pppmatching

Plot a Point Matching
is.ppp

Test Whether An Object Is A Point Pattern
plot.psp

plot a Spatial Line Segment Pattern
pppmatching.object

Class of Point Matchings
perimeter

Perimeter Length of Window
midpoints.psp

Midpoints of Line Segment Pattern
ppx

Multidimensional Space-Time Point Pattern
psp

Create a Line Segment Pattern
pixellate.ppp

Convert Point Pattern to Pixel Image
pixellate.psp

Convert Line Segment Pattern to Pixel Image
methods.boxx

Methods for Multi-Dimensional Box
psp.object

Class of Line Segment Patterns
is.rectangle

Determine Type of Window
nncross.pp3

Nearest Neighbours Between Two Patterns in 3D
nearestValue

Image of Nearest Defined Pixel Value
methods.distfun

Geometrical Operations for Distance Functions
nearestsegment

Find Line Segment Nearest to Each Point
quantess

Quantile Tessellation
nncross.ppx

Nearest Neighbours Between Two Patterns in Any Dimensions
methods.funxy

Methods for Spatial Functions
plot.symbolmap

Plot a Graphics Symbol Map
quantile.ewcdf

Quantiles of Weighted Empirical Cumulative Distribution Function
nnfun

Nearest Neighbour Index Map as a Function
nnmap

K-th Nearest Point Map
plot.onearrow

Plot an Arrow
plot.owin

Plot a Spatial Window
plot.tess

Plot a Tessellation
rescale

Convert dataset to another unit of length
plot.yardstick

Plot a Yardstick or Scale Bar
owin

Create a Window
nnmark

Mark of Nearest Neighbour
pointsOnLines

Place Points Evenly Along Specified Lines
print.ppp

Print Brief Details of a Point Pattern Dataset
rescale.im

Convert Pixel Image to Another Unit of Length
nnwhich.pp3

Nearest neighbours in three dimensions
project2segment

Move Point To Nearest Line
print.psp

Print Brief Details of a Line Segment Pattern Dataset
owin.object

Class owin
pairdist.default

Pairwise distances
rjitter

Random Perturbation of a Point Pattern
project2set

Find Nearest Point in a Region
rlinegrid

Generate grid of parallel lines with random displacement
nnwhich

Nearest neighbour
pairdist.pp3

Pairwise distances in Three Dimensions
quadratcount

Quadrat counting for a point pattern
owin2mask

Convert Window to Binary Mask under Constraints
round.ppp

Apply Numerical Rounding to Spatial Coordinates
rounding

Detect Numerical Rounding
plot.pp3

Plot a Three-Dimensional Point Pattern
quadrats

Divide Region into Quadrats
pHcolourmap

Colour Map for pH Values
quadscheme

Generate a Quadrature Scheme from a Point Pattern
shift

Apply Vector Translation
quadscheme.logi

Generate a Logistic Regression Quadrature Scheme from a Point Pattern
plot.im

Plot a Pixel Image
rotate

Rotate
plot.imlist

Plot a List of Images
plot.ppp

plot a Spatial Point Pattern
rescale.owin

Convert Window to Another Unit of Length
plot.solist

Plot a List of Spatial Objects
plot.splitppp

Plot a List of Point Patterns
rescale.ppp

Convert Point Pattern to Another Unit of Length
rotate.im

Rotate a Pixel Image
shift.im

Apply Vector Translation To Pixel Image
plot.textstring

Plot a Text String
runifrect

Generate N Uniform Random Points in a Rectangle
rgbim

Create Colour-Valued Pixel Image
nnwhich.ppx

Nearest Neighbours in Any Dimensions
opening

Morphological Opening
square

Square Window
overlap.owin

Compute Area of Overlap
perspPoints

Draw Points or Lines on a Surface Viewed in Perspective
ripras

Estimate window from points alone
stratrand

Stratified random point pattern
plot.texturemap

Plot a Texture Map
summary.quad

Summarizing a Quadrature Scheme
pixelcentres

Extract Pixel Centres as Point Pattern
pixelquad

Quadrature Scheme Based on Pixel Grid
scalardilate

Apply Scalar Dilation
shift.ppx

Apply Vector Translation To Box Or Point Pattern In Arbitrary Dimension
summary.solist

Summary of a List of Spatial Objects
test.crossing.psp

Check Whether Segments Cross
plot.anylist

Plot a List of Things
print.im

Print Brief Details of an Image
print.owin

Print Brief Details of a Spatial Window
text.ppp

Add Text Labels to Spatial Pattern
plot.layered

Layered Plot
plot.listof

Plot a List of Things
psp2mask

Convert Line Segment Pattern to Binary Pixel Mask
shift.psp

Apply Vector Translation To Line Segment Pattern
solist

List of Two-Dimensional Spatial Objects
rsyst

Simulate systematic random point pattern
trim.rectangle

Cut margins from rectangle
tweak.colourmap

Change Colour Values in a Colour Map
quad.object

Class of Quadrature Schemes
polartess

Tessellation Using Polar Coordinates
union.quad

Union of Data and Dummy Points
unique.ppp

Extract Unique Points from a Spatial Point Pattern
ppp

Create a Point Pattern
pp3

Three Dimensional Point Pattern
venn.tess

Tessellation Delimited by Several Sets
solutionset

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

Distance Between Two Point Patterns
quantile.im

Sample Quantiles of Pixel Image
vertices

Vertices of a Window
pppmatching

Create a Point Matching
print.quad

Print a Quadrature Scheme
progressreport

Print Progress Reports
quantilefun

Quantile Function
reflect

Reflect In Origin
ppp.object

Class of Point Patterns
raster.x

Cartesian Coordinates for a Pixel Raster
quasirandom

Quasirandom Patterns
regularpolygon

Create A Regular Polygon
subset.hyperframe

Subset of Hyperframe Satisfying A Condition
subset.ppp

Subset of Point Pattern Satisfying A Condition
run.simplepanel

Run Point-and-Click Interface
selfcrossing.psp

Crossing Points in a Line Segment Pattern
summary.ppp

Summary of a Point Pattern Dataset
summary.psp

Summary of a Line Segment Pattern Dataset
selfcut.psp

Cut Line Segments Where They Intersect
rotate.infline

Rotate or Shift Infinite Lines
rotate.owin

Rotate a Window
rQuasi

Generate Quasirandom Point Pattern in Given Window
sidelengths.owin

Side Lengths of Enclosing Rectangle of a Window
sessionLibs

Print Names and Version Numbers of Libraries Loaded
rescale.psp

Convert Line Segment Pattern to Another Unit of Length
rectdistmap

Distance Map Using Rectangular Distance Metric
tiles.empty

Check For Empty Tiles in a Tessellation
timeTaken

Extract the Total Computation Time
setcov

Set Covariance of a Window
rescue.rectangle

Convert Window Back To Rectangle
relevel.im

Reorder Levels of a Factor-Valued Image or Pattern
rotate.ppp

Rotate a Point Pattern
simplepanel

Simple Point-and-Click Interface Panels
requireversion

Require a Specific Version of a Package
uniquemap.default

Map Duplicate Entries to Unique Entries
rotate.psp

Rotate a Line Segment Pattern
restrict.colourmap

Restrict a Colour Map to a Subset of Values
spatdim

Spatial Dimension of a Dataset
rexplode

Explode a Point Pattern by Displacing Duplicated Points
scaletointerval

Rescale Data to Lie Between Specified Limits
spatstat.geom-deprecated

Deprecated spatstat.geom functions
scanpp

Read Point Pattern From Data File
shift.owin

Apply Vector Translation To Window
split.ppx

Divide Multidimensional Point Pattern into Sub-patterns
spokes

Spokes pattern of dummy points
shift.ppp

Apply Vector Translation To Point Pattern
subset.psp

Subset of Line Segment Satisfying A Condition
uniquemap.ppp

Map Duplicate Entries to Unique Entries
simplify.owin

Approximate a Polygon by a Simpler Polygon
summary.anylist

Summary of a List of Things
solapply

Apply a Function Over a List and Obtain a List of Objects
split.im

Divide Image Into Sub-images
tile.areas

Compute Areas of Tiles in a Tessellation
summary.distfun

Summarizing a Function of Spatial Location
summary.im

Summarizing a Pixel Image
texturemap

Texture Map
textureplot

Plot Image or Tessellation Using Texture Fill
tileindex

Determine Which Tile Contains Each Given Point
tilenames

Names of Tiles in a Tessellation
transmat

Convert Pixel Array Between Different Conventions
split.ppp

Divide Point Pattern into Sub-patterns
triangulate.owin

Decompose Window into Triangles
tiles

Extract List of Tiles in a Tessellation
spatstat.geom-internal

Internal spatstat.geom functions
summary.listof

Summary of a List of Things
unstack.solist

Unstack Each Spatial Object in a List of Objects
spatstat.geom-package

The spatstat.geom Package
summary.owin

Summary of a Spatial Window
update.symbolmap

Update a Graphics Symbol Map.
spatstat.options

Internal Options in Spatstat Package
split.hyperframe

Divide Hyperframe Into Subsets and Reassemble
summary.splitppp

Summary of a Split Point Pattern
symbolmap

Graphics Symbol Map
superimpose

Superimpose Several Geometric Patterns
unitname

Name for Unit of Length
yardstick

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

Rounding of Pixel Values
tess

Create a Tessellation
unnormdensity

Weighted kernel smoother
timed

Record the Computation Time
transformquantiles

Transform the Quantiles
unmark

Remove Marks
whist

Weighted Histogram
with.hyperframe

Evaluate an Expression in Each Row of a Hyperframe
volume

Volume of an Object
weighted.median

Weighted Median, Quantiles or Variance
unstack.ppp

Separate Multiple Columns of Marks
where.max

Find Location of Maximum in a Pixel Image
whichhalfplane

Test Which Side of Infinite Line a Point Falls On