Learn R Programming

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

spatstat.geom (version 3.2-9)

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

53,883

Version

3.2-9

License

GPL (>= 2)

Maintainer

Adrian Baddeley

Last Published

February 28th, 2024

Functions in spatstat.geom (3.2-9)

Extract.psp

Extract Subset of Line Segment Pattern
Extract.listof

Extract or Replace Subset of a List of Things
Math.imlist

S3 Group Generic methods for List of Images
MinkowskiSum

Minkowski Sum of Windows
Extract.owin

Extract Subset of Window
Extract.quad

Subset of Quadrature Scheme
Replace.im

Reset Values in Subset of Image
anylist

List of Objects
affine.tess

Apply Geometrical Transformation To Tessellation
Extract.ppp

Extract or Replace Subset of Point Pattern
affine.im

Apply Affine Transformation To Pixel Image
affine.owin

Apply Affine Transformation To Window
Math.im

S3 Group Generic methods for images
as.matrix.owin

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

Coerce Line Segment Pattern to a Data Frame
as.ppp

Convert Data To Class ppp
colourmap

Colour Lookup Tables
Extract.im

Extract Subset of Image
angles.psp

Orientation Angles of Line Segments
Frame

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

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

Extract Subset of Multidimensional Point Pattern
as.data.frame.tess

Convert Tessellation to Data Frame
add.texture

Fill Plot With Texture
append.psp

Combine Two Line Segment Patterns
applynbd

Apply Function to Every Neighbourhood in a Point Pattern
Extract.tess

Extract or Replace Subset of Tessellation
Extract.hyperframe

Extract or Replace Subset of Hyperframe
affine

Apply Affine Transformation
area.owin

Area of a Window
closepairs.pp3

Close Pairs of Points in 3 Dimensions
as.function.tess

Convert a Tessellation to a Function
as.owin

Convert Data To Class owin
as.data.frame.hyperframe

Coerce Hyperframe to Data Frame
as.polygonal

Convert a Window to a Polygonal Window
convexmetric

Distance Metric Defined by Convex Set
Extract.layered

Extract or Replace Subset of a Layered Object
as.rectangle

Window Frame
covering

Cover Region with Discs
as.data.frame.im

Convert Pixel Image to Data Frame
as.colourmap

Convert to Colour Map
affine.ppp

Apply Affine Transformation To Point Pattern
bdist.points

Distance to Boundary of Window
bdist.tiles

Distance to Boundary of Window
convexhull

Convex Hull
as.hyperframe

Convert Data to Hyperframe
as.solist

Convert List of Two-Dimensional Spatial Objects
Extract.solist

Extract or Replace Subset of a List of Spatial Objects
deltametric

Delta Metric
cbind.hyperframe

Combine Hyperframes by Rows or by Columns
boundingcircle

Smallest Enclosing Circle
clickdist

Interactively Measure Distance
box3

Three-Dimensional Box
areaLoss

Difference of Disc Areas
Window

Extract or Change the Window of a Spatial Object
centroid.owin

Centroid of a window
Window.tess

Extract Window of Spatial Object
closepairs

Close Pairs of Points
closetriples

Close Triples of Points
affine.psp

Apply Affine Transformation To Line Segment Pattern
Extract.splitppp

Extract or Replace Sub-Patterns
delaunayDistance

Distance on Delaunay Triangulation
clickpoly

Interactively Define a Polygon
anyNA.im

Check Whether Image Contains NA Values
as.box3

Convert Data to Three-Dimensional Box
closing

Morphological Closing
dilation

Morphological Dilation
diameter.boxx

Geometrical Calculations for Multi-Dimensional Box
clickppp

Interactively Add Points
clip.infline

Intersect Infinite Straight Lines with a Window
as.data.frame.owin

Convert Window to Data Frame
colouroutputs

Extract or Assign Colour Values in a Colour Map
as.function.im

Convert Pixel Image to Function of Coordinates
beachcolours

Create Colour Scheme for a Range of Numbers
areaGain

Difference of Disc Areas
as.hyperframe.ppx

Extract coordinates and marks of multidimensional point pattern
connected

Connected components
boxx

Multi-Dimensional Box
crossdist.default

Pairwise distances between two different sets of points
as.boxx

Convert Data to Multi-Dimensional Box
crossdist.pp3

Pairwise distances between two different three-dimensional point patterns
as.data.frame.ppp

Coerce Point Pattern to a Data Frame
as.im

Convert to Pixel Image
crossdist.psp

Pairwise distances between two different line segment patterns
distmap

Distance Map
contour.imlist

Array of Contour Plots
cut.im

Convert Pixel Image from Numeric to Factor
compatible

Test Whether Objects Are Compatible
bounding.box.xy

Convex Hull of Points
border

Border Region of a Window
intensity.ppx

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

Convert Data To Class psp
as.function.owin

Convert Window to Indicator Function
cut.ppp

Classify Points in a Point Pattern
diameter.owin

Diameter of a Window
as.matrix.im

Convert Pixel Image to Matrix or Array
as.mask

Pixel Image Approximation of a Window
connected.ppp

Connected Components of a Point Pattern
coords

Extract or Change Coordinates of a Spatial or Spatiotemporal Point Pattern
contour.im

Contour plot of pixel image
ewcdf

Weighted Empirical Cumulative Distribution Function
convexhull.xy

Convex Hull of Points
corners

Corners of a rectangle
as.layered

Convert Data To Layered Object
boundingbox

Bounding Box of a Window, Image, or Point Pattern
as.tess

Convert Data To Tessellation
by.im

Apply Function to Image Broken Down by Factor
distmap.owin

Distance Map of Window
bdist.pixels

Distance to Boundary of Window
diameter

Diameter of an Object
crossdist.ppp

Pairwise distances between two different point patterns
diameter.box3

Geometrical Calculations for Three-Dimensional Box
integral

Integral of a Function or Spatial Object
crossdist.ppx

Pairwise Distances Between Two Different Multi-Dimensional Point Patterns
commonGrid

Determine A Common Spatial Domain And Pixel Resolution
dirichletAreas

Compute Areas of Tiles in Dirichlet Tessellation
disc

Circular Window
domain

Extract the Domain of any Spatial Object
extrapolate.psp

Extrapolate Line Segments to Obtain Infinite Lines
dirichletVertices

Vertices and Edges of Dirichlet Tessellation
funxy

Spatial Function Class
dirichletWeights

Compute Quadrature Weights Based on Dirichlet Tessellation
bufftess

Buffer Distance Tessellation
discpartarea

Area of Part of Disc
edges2triangles

List Triangles in a Graph
by.ppp

Apply a Function to a Point Pattern Broken Down by Factor
edit.hyperframe

Invoke Text Editor on Hyperframe
pHcolourmap

Colour Map for pH Values
colourtools

Convert and Compare Colours in Different Formats
crossdist

Pairwise distances
edges2vees

List Dihedral Triples in a Graph
chop.tess

Subdivide a Window or Tessellation using a Set of Lines
fardist

Farthest Distance to Boundary of Window
edit.ppp

Invoke Text Editor on Spatial Data
harmonise.im

Make Pixel Images Compatible
clickbox

Interactively Define a Rectangle
inside.boxx

Test Whether Points Are Inside A Multidimensional Box
connected.tess

Connected Components of Tiles of a Tessellation
convolve.im

Convolution of Pixel Images
distfun

Distance Map as a Function
is.marked.ppp

Test Whether A Point Pattern is Marked
crossing.psp

Crossing Points of Two Line Segment Patterns
harmonise.owin

Make Windows Compatible
eval.im

Evaluate Expression Involving Pixel Images
flipxy

Exchange X and Y Coordinates
incircle

Find Largest Circle Inside Window
dilated.areas

Areas of Morphological Dilations
infline

Infinite Straight Lines
complement.owin

Take Complement of a Window
endpoints.psp

Endpoints of Line Segment Pattern
hist.funxy

Histogram of Values of a Spatial Function
erosionAny

Morphological Erosion of Windows
im

Create a Pixel Image Object
headtail

First or Last Part of a Spatial Pattern
duplicated.ppp

Determine Duplicated Points in a Spatial Point Pattern
grow.rectangle

Add margins to rectangle
nestsplit

Nested Split
distmap.psp

Distance Map of Line Segment Pattern
padimage

Pad the Border of a Pixel Image
ppx

Multidimensional Space-Time Point Pattern
pixellate.psp

Convert Line Segment Pattern to Pixel Image
hextess

Hexagonal Grid or Tessellation
concatxy

Concatenate x,y Coordinate Vectors
ellipse

Elliptical Window.
is.connected

Determine Whether an Object is Connected
identify.ppp

Identify Points in a Point Pattern
im.apply

Apply Function Pixelwise to List of Images
intersect.boxx

Intersection Of Boxes Of Arbitrary Dimension
integral.im

Integral of a Pixel Image
mean.ewcdf

Mean of Empirical Cumulative Distribution Function
intersect.owin

Intersection, Union or Set Subtraction of Windows
mean.im

Mean and Median of Pixel Values in an Image
identify.psp

Identify Segments in a Line Segment Pattern
is.multitype.ppp

Test Whether A Point Pattern is Multitype
is.lpp

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

Intensity of a Dataset or a Model
is.linnet

Test Whether An Object Is A Linear Network
nearest.raster.point

Find Pixel Nearest to a Given Point
is.multitype

Test whether Object is Multitype
maxnndist

Compute Minimum or Maximum Nearest-Neighbour Distance
harmoniseLevels

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

Rectangular grid of points
nearestValue

Image of Nearest Defined Pixel Value
distmap.ppp

Distance Map of Point Pattern
is.im

Test Whether An Object Is A Pixel Image
is.connected.ppp

Determine Whether a Point Pattern is Connected
inside.owin

Test Whether Points Are Inside A Window
nnmap

K-th Nearest Point Map
im.object

Class of Images
imcov

Spatial Covariance of a Pixel Image
intersect.tess

Intersection of Two Tessellations
edges

Extract Boundary Edges of a Window.
compatible.im

Test Whether Pixel Images Are Compatible
gridweights

Compute Quadrature Weights Based on Grid Counts
pairdist.pp3

Pairwise distances in Three Dimensions
plot.solist

Plot a List of Spatial Objects
nnmark

Mark of Nearest Neighbour
hist.im

Histogram of Pixel Values in an Image
summary.quad

Summarizing a Quadrature Scheme
has.close

Check Whether Points Have Close Neighbours
discretise

Safely Convert Point Pattern Window to Binary Mask
methods.boxx

Methods for Multi-Dimensional Box
marks

Marks of a Point Pattern
grow.boxx

Add margins to box in any dimension
intensity.quadratcount

Intensity Estimates Using Quadrat Counts
psp

Create a Line Segment Pattern
methods.funxy

Methods for Spatial Functions
invoke.symbolmap

Plot Data Using Graphics Symbol Map
nnfun

Nearest Neighbour Index Map as a Function
is.owin

Test Whether An Object Is A Window
integral.density

Compute Integral of One-Dimensional Kernel Density Estimate.
layout.boxes

Generate a Row or Column Arrangement of Rectangles.
marks.psp

Marks of a Line Segment Pattern
is.boxx

Recognise a Multi-Dimensional Box
overlap.owin

Compute Area of Overlap
tiles.empty

Check For Empty Tiles in a Tessellation
invoke.metric

Perform Geometric Task using a Specified Metric
is.convex

Test Whether a Window is Convex
is.linim

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

Geometrical Operations for Distance Functions
lengths_psp

Lengths of Line Segments
owin

Create a Window
nearestsegment

Find Line Segment Nearest to Each Point
convexify

Weil's Convexifying Operation
interp.im

Interpolate a Pixel Image
default.dummy

Generate a Default Pattern of Dummy Points
marks.tess

Marks of a Tessellation
persp.im

Perspective Plot of Pixel Image
perspPoints

Draw Points or Lines on a Surface Viewed in Perspective
intensity.psp

Empirical Intensity of Line Segment Pattern
is.rectangle

Determine Type of Window
levelset

Level Set of a Pixel Image
is.subset.owin

Determine Whether One Window is Contained In Another
plot.owin

Plot a Spatial Window
methods.pp3

Methods for three-dimensional point patterns
shift.psp

Apply Vector Translation To Line Segment Pattern
delaunay

Delaunay Triangulation of Point Pattern
lut

Lookup Tables
dirichlet

Dirichlet Tessellation of Point Pattern
markstat

Summarise Marks in Every Neighbourhood in a Point Pattern
methods.ppx

Methods for Multidimensional Space-Time Point Patterns
nncross

Nearest Neighbours Between Two Patterns
nndist.psp

Nearest neighbour distances between line segments
plot.pp3

Plot a Three-Dimensional Point Pattern
eroded.areas

Areas of Morphological Erosions
metric.object

Distance Metric
is.empty

Test Whether An Object Is Empty
discs

Union of Discs
plot.tess

Plot a Tessellation
pairdist

Pairwise distances
harmonise

Make Objects Compatible
pixellate.owin

Convert Window to Pixel Image
intensity.ppp

Empirical Intensity of Point Pattern
methods.layered

Methods for Layered Objects
nncross.pp3

Nearest Neighbours Between Two Patterns in 3D
nndist.pp3

Nearest neighbour distances in three dimensions
nncross.ppx

Nearest Neighbours Between Two Patterns in Any Dimensions
plot.splitppp

Plot a List of Point Patterns
erosion

Morphological Erosion by a Disc
nndist

Nearest neighbour distances
plot.symbolmap

Plot a Graphics Symbol Map
pppmatching

Create a Point Matching
nndist.ppx

Nearest Neighbour Distances in Any Dimensions
is.ppp

Test Whether An Object Is A Point Pattern
hotrod

Heat Kernel for a One-Dimensional Rod
tileindex

Determine Which Tile Contains Each Given Point
selfcut.psp

Cut Line Segments Where They Intersect
pppmatching.object

Class of Point Matchings
fourierbasis

Fourier Basis Functions
plot.textstring

Plot a Text String
rescale

Convert dataset to another unit of length
methods.unitname

Methods for Units
plot.listof

Plot a List of Things
rescale.im

Convert Pixel Image to Another Unit of Length
transmat

Convert Pixel Array Between Different Conventions
rsyst

Simulate systematic random point pattern
pairdist.default

Pairwise distances
midpoints.psp

Midpoints of Line Segment Pattern
multiplicity.ppp

Count Multiplicity of Duplicate Points
pairdist.ppp

Pairwise distances
run.simplepanel

Run Point-and-Click Interface
shift

Apply Vector Translation
framedist.pixels

Distance to Bounding Frame
shift.im

Apply Vector Translation To Pixel Image
selfcrossing.psp

Crossing Points in a Line Segment Pattern
nvertices

Count Number of Vertices
pixellate.ppp

Convert Point Pattern to Pixel Image
nnwhich

Nearest neighbour
npoints

Number of Points in a Point Pattern
perimeter

Perimeter Length of Window
hyperframe

Hyper Data Frame
solist

List of Two-Dimensional Spatial Objects
opening

Morphological Opening
interp.colourmap

Interpolate smoothly between specified colours
solutionset

Evaluate Logical Expression Involving Pixel Images and Return Region Where Expression is True
methods.box3

Methods for Three-Dimensional Box
square

Square Window
stratrand

Stratified random point pattern
subset.psp

Subset of Line Segment Satisfying A Condition
owin.object

Class owin
polartess

Tessellation Using Polar Coordinates
quadscheme

Generate a Quadrature Scheme from a Point Pattern
print.psp

Print Brief Details of a Line Segment Pattern Dataset
project2set

Find Nearest Point in a Region
layerplotargs

Extract or Replace the Plot Arguments of a Layered Object
nsegments

Number of Line Segments in a Line Segment Pattern
summary.anylist

Summary of a List of Things
plot.pppmatching

Plot a Point Matching
plot.yardstick

Plot a Yardstick or Scale Bar
is.marked

Test Whether Marks Are Present
nnwhich.pp3

Nearest neighbours in three dimensions
plot.hyperframe

Plot Entries in a Hyperframe
pairdist.ppx

Pairwise Distances in Any Dimensions
quad.object

Class of Quadrature Schemes
pairdist.psp

Pairwise distances between line segments
rQuasi

Generate Quasirandom Point Pattern in Given Window
texturemap

Texture Map
owin2mask

Convert Window to Binary Mask under Constraints
periodify

Make Periodic Copies of a Spatial Pattern
plot.ppp

plot a Spatial Point Pattern
pixelcentres

Extract Pixel Centres as Point Pattern
quasirandom

Quasirandom Patterns
restrict.colourmap

Restrict a Colour Map to a Subset of Values
summary.listof

Summary of a List of Things
pixelquad

Quadrature Scheme Based on Pixel Grid
plot.quadratcount

Plot Quadrat Counts
textureplot

Plot Image or Tessellation Using Texture Fill
print.quad

Print a Quadrature Scheme
union.quad

Union of Data and Dummy Points
timeTaken

Extract the Total Computation Time
relevel.im

Reorder Levels of a Factor-Valued Image or Pattern
shift.ppx

Apply Vector Translation To Box Or Point Pattern In Arbitrary Dimension
plot.onearrow

Plot an Arrow
rexplode

Explode a Point Pattern by Displacing Duplicated Points
plot.im

Plot a Pixel Image
unique.ppp

Extract Unique Points from a Spatial Point Pattern
unstack.solist

Unstack Each Spatial Object in a List of Objects
requireversion

Require a Specific Version of a Package
pixellate

Convert Spatial Object to Pixel Image
update.symbolmap

Update a Graphics Symbol Map.
pointsOnLines

Place Points Evenly Along Specified Lines
plot.imlist

Plot a List of Images
rotate.im

Rotate a Pixel Image
split.ppp

Divide Point Pattern into Sub-patterns
plot.layered

Layered Plot
spatstat.geom-internal

Internal spatstat.geom functions
rgbim

Create Colour-Valued Pixel Image
ppp.object

Class of Point Patterns
ripras

Estimate window from points alone
pppdist

Distance Between Two Point Patterns
psp.object

Class of Line Segment Patterns
print.im

Print Brief Details of an Image
rotate.ppp

Rotate a Point Pattern
rotate.psp

Rotate a Line Segment Pattern
rotate.infline

Rotate or Shift Infinite Lines
summary.psp

Summary of a Line Segment Pattern Dataset
unnormdensity

Weighted kernel smoother
quadrats

Divide Region into Quadrats
quadscheme.logi

Generate a Logistic Regression Quadrature Scheme from a Point Pattern
nnwhich.ppx

Nearest Neighbours in Any Dimensions
mergeLevels

Merge Levels of a Factor
print.owin

Print Brief Details of a Spatial Window
symbolmap

Graphics Symbol Map
quantess

Quantile Tessellation
shift.ppp

Apply Vector Translation To Point Pattern
split.im

Divide Image Into Sub-images
shift.owin

Apply Vector Translation To Window
quantile.ewcdf

Quantiles of Weighted Empirical Cumulative Distribution Function
layered

Create List of Plotting Layers
quantile.im

Sample Quantiles of Pixel Image
print.ppp

Print Brief Details of a Point Pattern Dataset
summary.ppp

Summary of a Point Pattern Dataset
psp2mask

Convert Line Segment Pattern to Binary Pixel Mask
simplify.owin

Approximate a Polygon by a Simpler Polygon
quadratcount

Quadrat counting for a point pattern
quantilefun

Quantile Function
matchingdist

Distance for a Point Pattern Matching
tile.areas

Compute Areas of Tiles in a Tessellation
whist

Weighted Histogram
rotate

Rotate
summary.solist

Summary of a List of Spatial Objects
venn.tess

Tessellation Delimited by Several Sets
unstack.ppp

Separate Multiple Columns of Marks
quantilefun.im

Quantile Function for Images
vertices

Vertices of a Window
pp3

Three Dimensional Point Pattern
rescale.owin

Convert Window to Another Unit of Length
spatstat.geom-package

The spatstat.geom Package
nobjects

Count Number of Geometrical Objects in a Spatial Dataset
rescale.ppp

Convert Point Pattern to Another Unit of Length
plot.anylist

Plot a List of Things
rectdistmap

Distance Map Using Rectangular Distance Metric
trim.rectangle

Cut margins from rectangle
plot.psp

plot a Spatial Line Segment Pattern
reflect

Reflect In Origin
raster.x

Cartesian Coordinates for a Pixel Raster
rjitter

Random Perturbation of a Point Pattern
rlinegrid

Generate grid of parallel lines with random displacement
runifrect

Generate N Uniform Random Points in a Rectangle
tess

Create a Tessellation
rotate.owin

Rotate a Window
plot.texturemap

Plot a Texture Map
tweak.colourmap

Change Colour Values in a Colour Map
scalardilate

Apply Scalar Dilation
volume

Volume of an Object
plot.colourmap

Plot a Colour Map
with.hyperframe

Evaluate an Expression in Each Row of a Hyperframe
plot.quad

Plot a Spatial Quadrature Scheme
scaletointerval

Rescale Data to Lie Between Specified Limits
progressreport

Print Progress Reports
project2segment

Move Point To Nearest Line
weighted.median

Weighted Median, Quantiles or Variance
solapply

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

Summary of a Spatial Window
timed

Record the Computation Time
ppp

Create a Point Pattern
transformquantiles

Transform the Quantiles
uniquemap.default

Map Duplicate Entries to Unique Entries
spatstat.options

Internal Options in Spatstat Package
scanpp

Read Point Pattern From Data File
regularpolygon

Create A Regular Polygon
uniquemap.ppp

Map Duplicate Entries to Unique Entries
spatdim

Spatial Dimension of a Dataset
spatstat.geom-deprecated

Deprecated spatstat.geom functions
split.ppx

Divide Multidimensional Point Pattern into Sub-patterns
spokes

Spokes pattern of dummy points
subset.hyperframe

Subset of Hyperframe Satisfying A Condition
rescale.psp

Convert Line Segment Pattern to Another Unit of Length
subset.ppp

Subset of Point Pattern Satisfying A Condition
simplepanel

Simple Point-and-Click Interface Panels
test.crossing.psp

Check Whether Segments Cross
split.hyperframe

Divide Hyperframe Into Subsets and Reassemble
setcov

Set Covariance of a Window
round.ppp

Apply Numerical Rounding to Spatial Coordinates
text.ppp

Add Text Labels to Spatial Pattern
tilenames

Names of Tiles in a Tessellation
tiles

Extract List of Tiles in a Tessellation
unitname

Name for Unit of Length
sidelengths.owin

Side Lengths of Enclosing Rectangle of a Window
rescue.rectangle

Convert Window Back To Rectangle
unmark

Remove Marks
rounding

Detect Numerical Rounding
sessionLibs

Print Names and Version Numbers of Libraries Loaded
triangulate.owin

Decompose Window into Triangles
where.max

Find Location of Maximum in a Pixel Image
summary.distfun

Summarizing a Function of Spatial Location
superimpose

Superimpose Several Geometric Patterns
summary.splitppp

Summary of a Split Point Pattern
summary.im

Summarizing a Pixel Image
whichhalfplane

Test Which Side of Infinite Line a Point Falls On
yardstick

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

Rounding of Pixel Values