Learn R Programming

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

spatstat.geom (version 3.1-0)

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.1-0

License

GPL (>= 2)

Maintainer

Adrian Baddeley

Last Published

March 12th, 2023

Functions in spatstat.geom (3.1-0)

Extract.psp

Extract Subset of Line Segment Pattern
Extract.quad

Subset of Quadrature Scheme
Extract.ppp

Extract or Replace Subset of Point Pattern
as.box3

Convert Data to Three-Dimensional Box
closepairs

Close Pairs of Points
affine.im

Apply Affine Transformation To Pixel Image
append.psp

Combine Two Line Segment Patterns
Math.im

S3 Group Generic methods for images
clickbox

Interactively Define a Rectangle
bdist.pixels

Distance to Boundary of Window
MinkowskiSum

Minkowski Sum of Windows
bufftess

Buffer Distance Tessellation
Replace.im

Reset Values in Subset of Image
contour.im

Contour plot of pixel image
colourmap

Colour Lookup Tables
Extract.listof

Extract or Replace Subset of a List of Things
boundingbox

Bounding Box of a Window, Image, or Point Pattern
intensity.ppp

Empirical Intensity of Point Pattern
affine.owin

Apply Affine Transformation To Window
Frame

Extract or Change the Containing Rectangle of a Spatial Object
as.boxx

Convert Data to Multi-Dimensional Box
as.colourmap

Convert to Colour Map
diameter.box3

Geometrical Calculations for Three-Dimensional Box
as.data.frame.owin

Convert Window to Data Frame
connected

Connected components
add.texture

Fill Plot With Texture
as.hyperframe

Convert Data to Hyperframe
closetriples

Close Triples of Points
as.hyperframe.ppx

Extract coordinates and marks of multidimensional point pattern
convexmetric

Distance Metric Defined by Convex Set
as.matrix.owin

Convert Pixel Image to Matrix
as.layered

Convert Data To Layered Object
distfun

Distance Map as a Function
anylist

List of Objects
Extract.anylist

Extract or Replace Subset of a List of Things
bounding.box.xy

Convex Hull of Points
as.im

Convert to Pixel Image
headtail

First or Last Part of a Spatial Pattern
Extract.hyperframe

Extract or Replace Subset of Hyperframe
nncross.pp3

Nearest Neighbours Between Two Patterns in 3D
Window

Extract or Change the Window of a Spatial Object
affine.psp

Apply Affine Transformation To Line Segment Pattern
duplicated.ppp

Determine Duplicated Points in a Spatial Point Pattern
angles.psp

Orientation Angles of Line Segments
box3

Three-Dimensional Box
as.function.owin

Convert Window to Indicator Function
bdist.tiles

Distance to Boundary of Window
Extract.ppx

Extract Subset of Multidimensional Point Pattern
affine.ppp

Apply Affine Transformation To Point Pattern
boundingcircle

Smallest Enclosing Circle
as.owin

Convert Data To Class owin
affine

Apply Affine Transformation
Extract.tess

Extract or Replace Subset of Tessellation
edit.hyperframe

Invoke Text Editor on Hyperframe
areaLoss

Difference of Disc Areas
Extract.im

Extract Subset of Image
domain

Extract the Domain of any Spatial Object
affine.tess

Apply Geometrical Transformation To Tessellation
grow.boxx

Add margins to box in any dimension
as.psp

Convert Data To Class psp
closing

Morphological Closing
crossdist.pp3

Pairwise distances between two different three-dimensional point patterns
corners

Corners of a rectangle
Extract.layered

Extract or Replace Subset of a Layered Object
Extract.owin

Extract Subset of Window
closepairs.pp3

Close Pairs of Points in 3 Dimensions
as.data.frame.psp

Coerce Line Segment Pattern to a Data Frame
clip.infline

Intersect Infinite Straight Lines with a Window
Window.quad

Extract Window of Spatial Object
Extract.solist

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

Extract or Replace Sub-Patterns
as.polygonal

Convert a Window to a Polygonal Window
intensity

Intensity of a Dataset or a Model
as.mask.psp

Convert Line Segment Pattern to Binary Pixel Mask
integral.im

Integral of a Pixel Image
concatxy

Concatenate x,y Coordinate Vectors
applynbd

Apply Function to Every Neighbourhood in a Point Pattern
area.owin

Area of a Window
Math.imlist

S3 Group Generic methods for List of Images
anyNA.im

Check Whether Image Contains NA Values
by.im

Apply Function to Image Broken Down by Factor
crossdist

Pairwise distances
discretise

Safely Convert Point Pattern Window to Binary Mask
as.matrix.im

Convert Pixel Image to Matrix or Array
beachcolours

Create Colour Scheme for a Range of Numbers
border

Border Region of a Window
as.solist

Convert List of Two-Dimensional Spatial Objects
as.function.tess

Convert a Tessellation to a Function
crossing.psp

Crossing Points of Two Line Segment Patterns
as.rectangle

Window Frame
as.tess

Convert Data To Tessellation
clickpoly

Interactively Define a Polygon
crossdist.ppx

Pairwise Distances Between Two Different Multi-Dimensional Point Patterns
as.data.frame.tess

Convert Tessellation to Data Frame
contour.imlist

Array of Contour Plots
eval.im

Evaluate Expression Involving Pixel Images
convexhull.xy

Convex Hull of Points
clickdist

Interactively Measure Distance
interp.im

Interpolate a Pixel Image
identify.psp

Identify Segments in a Line Segment Pattern
as.ppp

Convert Data To Class ppp
dilation

Morphological Dilation
as.data.frame.hyperframe

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

Convert Pixel Image to Data Frame
connected.tess

Connected Components of Tiles of a Tessellation
deltametric

Delta Metric
inside.owin

Test Whether Points Are Inside A Window
crossdist.ppp

Pairwise distances between two different point patterns
covering

Cover Region with Discs
as.data.frame.ppp

Coerce Point Pattern to a Data Frame
crossdist.default

Pairwise distances between two different sets of points
dirichlet

Dirichlet Tessellation of Point Pattern
nndist

Nearest neighbour distances
areaGain

Difference of Disc Areas
diameter.boxx

Geometrical Calculations for Multi-Dimensional Box
convexhull

Convex Hull
compatible

Test Whether Objects Are Compatible
as.mask

Pixel Image Approximation of a Window
grow.rectangle

Add margins to rectangle
crossdist.psp

Pairwise distances between two different line segment patterns
split.ppp

Divide Point Pattern into Sub-patterns
bdist.points

Distance to Boundary of Window
funxy

Spatial Function Class
by.ppp

Apply a Function to a Point Pattern Broken Down by Factor
as.function.im

Convert Pixel Image to Function of Coordinates
colouroutputs

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

Distance Map of Point Pattern
integral.density

Compute Integral of One-Dimensional Kernel Density Estimate.
distmap.owin

Distance Map of Window
nncross

Nearest Neighbours Between Two Patterns
dirichletAreas

Compute Areas of Tiles in Dirichlet Tessellation
diameter

Diameter of an Object
print.im

Print Brief Details of an Image
inside.boxx

Test Whether Points Are Inside A Multidimensional Box
boxx

Multi-Dimensional Box
is.ppp

Test Whether An Object Is A Point Pattern
distmap.psp

Distance Map of Line Segment Pattern
cut.im

Convert Pixel Image from Numeric to Factor
connected.ppp

Connected Components of a Point Pattern
colourtools

Convert and Compare Colours in Different Formats
compatible.im

Test Whether Pixel Images Are Compatible
is.linnet

Test Whether An Object Is A Linear Network
marks.tess

Marks of a Tessellation
dirichletWeights

Compute Quadrature Weights Based on Dirichlet Tessellation
chop.tess

Subdivide a Window or Tessellation using a Set of Lines
distmap

Distance Map
harmonise.im

Make Pixel Images Compatible
discpartarea

Area of Part of Disc
imcov

Spatial Covariance of a Pixel Image
cbind.hyperframe

Combine Hyperframes by Rows or by Columns
commonGrid

Determine A Common Spatial Domain And Pixel Resolution
framedist.pixels

Distance to Bounding Frame
markstat

Summarise Marks in Every Neighbourhood in a Point Pattern
im.apply

Apply Function Pixelwise to List of Images
centroid.owin

Centroid of a window
convolve.im

Convolution of Pixel Images
plot.ppp

plot a Spatial Point Pattern
coords

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

Weil's Convexifying Operation
nnwhich.ppx

Nearest Neighbours in Any Dimensions
pairdist.pp3

Pairwise distances in Three Dimensions
eroded.areas

Areas of Morphological Erosions
hyperframe

Hyper Data Frame
is.multitype.ppp

Test Whether A Point Pattern is Multitype
fardist

Farthest Distance to Boundary of Window
rescue.rectangle

Convert Window Back To Rectangle
gridcentres

Rectangular grid of points
dirichletVertices

Vertices and Edges of Dirichlet Tessellation
diameter.owin

Diameter of a Window
extrapolate.psp

Extrapolate Line Segments to Obtain Infinite Lines
hist.im

Histogram of Pixel Values in an Image
maxnndist

Compute Minimum or Maximum Nearest-Neighbour Distance
methods.boxx

Methods for Multi-Dimensional Box
ewcdf

Weighted Empirical Cumulative Distribution Function
is.im

Test Whether An Object Is A Pixel Image
is.empty

Test Whether An Object Is Empty
delaunay

Delaunay Triangulation of Point Pattern
hist.funxy

Histogram of Values of a Spatial Function
clickppp

Interactively Add Points
edges2vees

List Dihedral Triples in a Graph
plot.splitppp

Plot a List of Point Patterns
edges

Extract Boundary Edges of a Window.
harmonise

Make Objects Compatible
gridweights

Compute Quadrature Weights Based on Grid Counts
infline

Infinite Straight Lines
disc

Circular Window
interp.colourmap

Interpolate smoothly between specified colours
delaunayDistance

Distance on Delaunay Triangulation
erosion

Morphological Erosion by a Disc
identify.ppp

Identify Points in a Point Pattern
edges2triangles

List Triangles in a Graph
im.object

Class of Images
complement.owin

Take Complement of a Window
dilated.areas

Areas of Morphological Dilations
nndist.ppx

Nearest Neighbour Distances in Any Dimensions
cut.ppp

Classify Points in a Point Pattern
has.close

Check Whether Points Have Close Neighbours
edit.ppp

Invoke Text Editor on Spatial Data
endpoints.psp

Endpoints of Line Segment Pattern
default.dummy

Generate a Default Pattern of Dummy Points
is.linim

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

Empirical Intensity of Line Segment Pattern
erosionAny

Morphological Erosion of Windows
plot.onearrow

Plot an Arrow
intersect.tess

Intersection of Two Tessellations
discs

Union of Discs
hotrod

Heat Kernel for a One-Dimensional Rod
rsyst

Simulate systematic random point pattern
is.connected

Determine Whether an Object is Connected
nearest.raster.point

Find Pixel Nearest to a Given Point
methods.box3

Methods for Three-Dimensional Box
harmonise.owin

Make Windows Compatible
ellipse

Elliptical Window.
opening

Morphological Opening
nsegments

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

Plot a List of Things
im

Create a Pixel Image Object
intensity.ppx

Intensity of a Multidimensional Space-Time Point Pattern
nnfun

Nearest Neighbour Index Map as a Function
nestsplit

Nested Split
quadscheme.logi

Generate a Logistic Regression Quadrature Scheme from a Point Pattern
mean.ewcdf

Mean of Empirical Cumulative Distribution Function
methods.pp3

Methods for three-dimensional point patterns
midpoints.psp

Midpoints of Line Segment Pattern
invoke.metric

Perform Geometric Task using a Specified Metric
pixellate.ppp

Convert Point Pattern to Pixel Image
is.subset.owin

Determine Whether One Window is Contained In Another
layered

Create List of Plotting Layers
intensity.quadratcount

Intensity Estimates Using Quadrat Counts
methods.ppx

Methods for Multidimensional Space-Time Point Patterns
flipxy

Exchange X and Y Coordinates
is.owin

Test Whether An Object Is A Window
fourierbasis

Fourier Basis Functions
harmoniseLevels

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

Test Whether An Object Is A Point Pattern on a Linear Network
methods.funxy

Methods for Spatial Functions
is.marked

Test Whether Marks Are Present
marks

Marks of a Point Pattern
pairdist.psp

Pairwise distances between line segments
pixelquad

Quadrature Scheme Based on Pixel Grid
marks.psp

Marks of a Line Segment Pattern
summary.quad

Summarizing a Quadrature Scheme
invoke.symbolmap

Plot Data Using Graphics Symbol Map
nnmap

K-th Nearest Point Map
lut

Lookup Tables
plot.symbolmap

Plot a Graphics Symbol Map
project2set

Find Nearest Point in a Region
with.hyperframe

Evaluate an Expression in Each Row of a Hyperframe
periodify

Make Periodic Copies of a Spatial Pattern
methods.distfun

Geometrical Operations for Distance Functions
nndist.psp

Nearest neighbour distances between line segments
is.rectangle

Determine Type of Window
methods.unitname

Methods for Units
is.connected.ppp

Determine Whether a Point Pattern is Connected
pairdist.default

Pairwise distances
mergeLevels

Merge Levels of a Factor
plot.hyperframe

Plot Entries in a Hyperframe
pairdist.ppp

Pairwise distances
quantilefun

Quantile Function
pixellate.owin

Convert Window to Pixel Image
multiplicity.ppp

Count Multiplicity of Duplicate Points
plot.layered

Layered Plot
hextess

Hexagonal Grid or Tessellation
plot.psp

plot a Spatial Line Segment Pattern
rotate.psp

Rotate a Line Segment Pattern
is.convex

Test Whether a Window is Convex
shift.psp

Apply Vector Translation To Line Segment Pattern
print.quad

Print a Quadrature Scheme
layout.boxes

Generate a Row or Column Arrangement of Rectangles.
run.simplepanel

Run Point-and-Click Interface
intersect.owin

Intersection, Union or Set Subtraction of Windows
nearestsegment

Find Line Segment Nearest to Each Point
intersect.boxx

Intersection Of Boxes Of Arbitrary Dimension
plot.owin

Plot a Spatial Window
layerplotargs

Extract or Replace the Plot Arguments of a Layered Object
solutionset

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

Print Brief Details of a Spatial Window
plot.colourmap

Plot a Colour Map
metric.object

Distance Metric
nndist.pp3

Nearest neighbour distances in three dimensions
overlap.owin

Compute Area of Overlap
is.marked.ppp

Test Whether A Point Pattern is Marked
sidelengths.owin

Side Lengths of Enclosing Rectangle of a Window
plot.tess

Plot a Tessellation
incircle

Find Largest Circle Inside Window
nobjects

Count Number of Geometrical Objects in a Spatial Dataset
levelset

Level Set of a Pixel Image
nnwhich.pp3

Nearest neighbours in three dimensions
plot.imlist

Plot a List of Images
owin

Create a Window
owin.object

Class owin
padimage

Pad the Border of a Pixel Image
plot.textstring

Plot a Text String
perimeter

Perimeter Length of Window
is.multitype

Test whether Object is Multitype
pixellate

Convert Spatial Object to Pixel Image
mean.im

Mean and Median of Pixel Values in an Image
matchingdist

Distance for a Point Pattern Matching
unique.ppp

Extract Unique Points from a Spatial Point Pattern
plot.pppmatching

Plot a Point Matching
rectdistmap

Distance Map Using Rectangular Distance Metric
nvertices

Count Number of Vertices
rounding

Detect Numerical Rounding
print.ppp

Print Brief Details of a Point Pattern Dataset
lengths_psp

Lengths of Line Segments
rescale.im

Convert Pixel Image to Another Unit of Length
nnmark

Mark of Nearest Neighbour
plot.quadratcount

Plot Quadrat Counts
plot.solist

Plot a List of Spatial Objects
pairdist

Pairwise distances
owin2mask

Convert Window to Binary Mask under Constraints
persp.im

Perspective Plot of Pixel Image
nearestValue

Image of Nearest Defined Pixel Value
pairdist.ppx

Pairwise Distances in Any Dimensions
whichhalfplane

Test Which Side of Infinite Line a Point Falls On
ppp

Create a Point Pattern
plot.yardstick

Plot a Yardstick or Scale Bar
plot.quad

Plot a Spatial Quadrature Scheme
nnwhich

Nearest neighbour
tileindex

Determine Which Tile Contains Each Given Point
psp.object

Class of Line Segment Patterns
rlinegrid

Generate grid of parallel lines with random displacement
print.psp

Print Brief Details of a Line Segment Pattern Dataset
psp

Create a Line Segment Pattern
plot.listof

Plot a List of Things
npoints

Number of Points in a Point Pattern
simplify.owin

Approximate a Polygon by a Simpler Polygon
summary.im

Summarizing a Pixel Image
methods.layered

Methods for Layered Objects
summary.listof

Summary of a List of Things
spatdim

Spatial Dimension of a Dataset
rescale.owin

Convert Window to Another Unit of Length
simplepanel

Simple Point-and-Click Interface Panels
pixellate.psp

Convert Line Segment Pattern to Pixel Image
quasirandom

Quasirandom Patterns
ppp.object

Class of Point Patterns
rotate

Rotate
quadrats

Divide Region into Quadrats
plot.texturemap

Plot a Texture Map
rgbim

Create Colour-Valued Pixel Image
summary.psp

Summary of a Line Segment Pattern Dataset
tiles

Extract List of Tiles in a Tessellation
shift.im

Apply Vector Translation To Pixel Image
sessionLibs

Print Names and Version Numbers of Libraries Loaded
scalardilate

Apply Scalar Dilation
summary.owin

Summary of a Spatial Window
ripras

Estimate window from points alone
quantess

Quantile Tessellation
split.ppx

Divide Multidimensional Point Pattern into Sub-patterns
plot.pp3

Plot a Three-Dimensional Point Pattern
split.im

Divide Image Into Sub-images
quad.object

Class of Quadrature Schemes
plot.im

Plot a Pixel Image
rotate.im

Rotate a Pixel Image
project2segment

Move Point To Nearest Line
nncross.ppx

Nearest Neighbours Between Two Patterns in Any Dimensions
tiles.empty

Check For Empty Tiles in a Tessellation
summary.ppp

Summary of a Point Pattern Dataset
rQuasi

Generate Quasirandom Point Pattern in Given Window
subset.psp

Subset of Line Segment Satisfying A Condition
rotate.infline

Rotate or Shift Infinite Lines
union.quad

Union of Data and Dummy Points
setcov

Set Covariance of a Window
unmark

Remove Marks
scanpp

Read Point Pattern From Data File
progressreport

Print Progress Reports
selfcut.psp

Cut Line Segments Where They Intersect
rescale.psp

Convert Line Segment Pattern to Another Unit of Length
whist

Weighted Histogram
unnormdensity

Weighted kernel smoother
raster.x

Cartesian Coordinates for a Pixel Raster
reflect

Reflect In Origin
rescale.ppp

Convert Point Pattern to Another Unit of Length
rexplode

Explode a Point Pattern by Displacing Duplicated Points
subset.hyperframe

Subset of Hyperframe Satisfying A Condition
stratrand

Stratified random point pattern
scaletointerval

Rescale Data to Lie Between Specified Limits
selfcrossing.psp

Crossing Points in a Line Segment Pattern
perspPoints

Draw Points or Lines on a Surface Viewed in Perspective
spatstat.geom-deprecated

Deprecated spatstat.geom functions
restrict.colourmap

Restrict a Colour Map to a Subset of Values
pHcolourmap

Colour Map for pH Values
shift.owin

Apply Vector Translation To Window
uniquemap.default

Map Duplicate Entries to Unique Entries
runifrect

Generate N Uniform Random Points in a Rectangle
pp3

Three Dimensional Point Pattern
symbolmap

Graphics Symbol Map
rjitter

Random Perturbation of a Point Pattern
tweak.colourmap

Change Colour Values in a Colour Map
shift.ppp

Apply Vector Translation To Point Pattern
superimpose

Superimpose Several Geometric Patterns
spatstat.geom-internal

Internal spatstat.geom functions
update.symbolmap

Update a Graphics Symbol Map.
shift.ppx

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

Plot Image or Tessellation Using Texture Fill
yardstick

Text, Arrow or Scale Bar in a Diagram
unstack.ppp

Separate Multiple Columns of Marks
pixelcentres

Extract Pixel Centres as Point Pattern
split.hyperframe

Divide Hyperframe Into Subsets and Reassemble
venn.tess

Tessellation Delimited by Several Sets
quadratcount

Quadrat counting for a point pattern
tess

Create a Tessellation
tilenames

Names of Tiles in a Tessellation
triangulate.owin

Decompose Window into Triangles
quantile.ewcdf

Quantiles of Weighted Empirical Cumulative Distribution Function
polartess

Tessellation Using Polar Coordinates
pppdist

Distance Between Two Point Patterns
test.crossing.psp

Check Whether Segments Cross
unstack.solist

Unstack Each Spatial Object in a List of Objects
trim.rectangle

Cut margins from rectangle
pointsOnLines

Place Points Evenly Along Specified Lines
solapply

Apply a Function Over a List and Obtain a List of Objects
pppmatching

Create a Point Matching
pppmatching.object

Class of Point Matchings
weighted.median

Weighted Median, Quantiles or Variance
rotate.owin

Rotate a Window
regularpolygon

Create A Regular Polygon
quadscheme

Generate a Quadrature Scheme from a Point Pattern
where.max

Find Location of Maximum in a Pixel Image
ppx

Multidimensional Space-Time Point Pattern
shift

Apply Vector Translation
relevel.im

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

Rotate a Point Pattern
round.ppp

Apply Numerical Rounding to Spatial Coordinates
summary.splitppp

Summary of a Split Point Pattern
requireversion

Require a Specific Version of a Package
summary.anylist

Summary of a List of Things
quantile.im

Sample Quantiles of Pixel Image
rescale

Convert dataset to another unit of length
subset.ppp

Subset of Point Pattern Satisfying A Condition
spatstat.geom-package

The spatstat.geom Package
summary.distfun

Summarizing a Function of Spatial Location
solist

List of Two-Dimensional Spatial Objects
text.ppp

Add Text Labels to Spatial Pattern
spatstat.options

Internal Options in Spatstat Package
spokes

Spokes pattern of dummy points
vertices

Vertices of a Window
texturemap

Texture Map
transformquantiles

Transform the Quantiles
square

Square Window
transmat

Convert Pixel Array Between Different Conventions
summary.solist

Summary of a List of Spatial Objects
timeTaken

Extract the Total Computation Time
uniquemap.ppp

Map Duplicate Entries to Unique Entries
volume

Volume of an Object
tile.areas

Compute Areas of Tiles in a Tessellation
zapsmall.im

Rounding of Pixel Values
timed

Record the Computation Time
unitname

Name for Unit of Length