Learn R Programming

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

spatstat.geom (version 3.2-5)

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

Version

3.2-5

License

GPL (>= 2)

Maintainer

Last Published

September 5th, 2023

Functions in spatstat.geom (3.2-5)

Extract.ppx

Extract Subset of Multidimensional Point Pattern
Extract.hyperframe

Extract or Replace Subset of Hyperframe
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.quad

Subset of Quadrature Scheme
Extract.owin

Extract Subset of Window
Extract.anylist

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

Extract Subset of Image
Extract.layered

Extract or Replace Subset of a Layered Object
Window

Extract or Change the Window of a Spatial Object
MinkowskiSum

Minkowski Sum of Windows
Replace.im

Reset Values in Subset of Image
Extract.tess

Extract or Replace Subset of Tessellation
Window.tess

Extract Window of Spatial Object
Frame

Extract or Change the Containing Rectangle of a Spatial Object
Math.im

S3 Group Generic methods for images
Extract.solist

Extract or Replace Subset of a List of Spatial Objects
Math.imlist

S3 Group Generic methods for List of Images
Extract.splitppp

Extract or Replace Sub-Patterns
affine.owin

Apply Affine Transformation To Window
affine.im

Apply Affine Transformation To Pixel Image
anyNA.im

Check Whether Image Contains NA Values
affine.ppp

Apply Affine Transformation To Point Pattern
add.texture

Fill Plot With Texture
affine.psp

Apply Affine Transformation To Line Segment Pattern
affine

Apply Affine Transformation
affine.tess

Apply Geometrical Transformation To Tessellation
as.data.frame.hyperframe

Coerce Hyperframe to Data Frame
append.psp

Combine Two Line Segment Patterns
anylist

List of Objects
as.boxx

Convert Data to Multi-Dimensional Box
applynbd

Apply Function to Every Neighbourhood in a Point Pattern
angles.psp

Orientation Angles of Line Segments
as.data.frame.im

Convert Pixel Image to Data Frame
as.colourmap

Convert to Colour Map
as.hyperframe.ppx

Extract coordinates and marks of multidimensional point pattern
as.data.frame.psp

Coerce Line Segment Pattern to a Data Frame
as.rectangle

Window Frame
areaLoss

Difference of Disc Areas
as.function.tess

Convert a Tessellation to a Function
as.hyperframe

Convert Data to Hyperframe
area.owin

Area of a Window
areaGain

Difference of Disc Areas
as.im

Convert to Pixel Image
as.function.im

Convert Pixel Image to Function of Coordinates
as.matrix.im

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

Convert Tessellation to Data Frame
as.owin

Convert Data To Class owin
as.solist

Convert List of Two-Dimensional Spatial Objects
as.box3

Convert Data to Three-Dimensional Box
bounding.box.xy

Convex Hull of Points
as.data.frame.owin

Convert Window to Data Frame
as.matrix.owin

Convert Pixel Image to Matrix
boundingbox

Bounding Box of a Window, Image, or Point Pattern
by.im

Apply Function to Image Broken Down by Factor
as.function.owin

Convert Window to Indicator Function
as.layered

Convert Data To Layered Object
by.ppp

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

Close Pairs of Points
as.ppp

Convert Data To Class ppp
as.data.frame.ppp

Coerce Point Pattern to a Data Frame
as.polygonal

Convert a Window to a Polygonal Window
beachcolours

Create Colour Scheme for a Range of Numbers
as.mask

Pixel Image Approximation of a Window
boundingcircle

Smallest Enclosing Circle
closepairs.pp3

Close Pairs of Points in 3 Dimensions
box3

Three-Dimensional Box
contour.imlist

Array of Contour Plots
border

Border Region of a Window
boxx

Multi-Dimensional Box
bdist.points

Distance to Boundary of Window
as.psp

Convert Data To Class psp
convexhull

Convex Hull
cbind.hyperframe

Combine Hyperframes by Rows or by Columns
bdist.tiles

Distance to Boundary of Window
clickdist

Interactively Measure Distance
bufftess

Buffer Distance Tessellation
chop.tess

Subdivide a Window or Tessellation using a Set of Lines
as.tess

Convert Data To Tessellation
clickppp

Interactively Add Points
clip.infline

Intersect Infinite Straight Lines with a Window
colourtools

Convert and Compare Colours in Different Formats
bdist.pixels

Distance to Boundary of Window
commonGrid

Determine A Common Spatial Domain And Pixel Resolution
convexhull.xy

Convex Hull of Points
centroid.owin

Centroid of a window
clickbox

Interactively Define a Rectangle
clickpoly

Interactively Define a Polygon
connected

Connected components
connected.ppp

Connected Components of a Point Pattern
convexmetric

Distance Metric Defined by Convex Set
deltametric

Delta Metric
compatible

Test Whether Objects Are Compatible
coords

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

Convolution of Pixel Images
connected.tess

Connected Components of Tiles of a Tessellation
colourmap

Colour Lookup Tables
crossdist.ppp

Pairwise distances between two different point patterns
compatible.im

Test Whether Pixel Images Are Compatible
corners

Corners of a rectangle
colouroutputs

Extract or Assign Colour Values in a Colour Map
convexify

Weil's Convexifying Operation
closetriples

Close Triples of Points
crossdist.ppx

Pairwise Distances Between Two Different Multi-Dimensional Point Patterns
crossdist.psp

Pairwise distances between two different line segment patterns
cut.im

Convert Pixel Image from Numeric to Factor
complement.owin

Take Complement of a Window
duplicated.ppp

Determine Duplicated Points in a Spatial Point Pattern
crossing.psp

Crossing Points of Two Line Segment Patterns
diameter.boxx

Geometrical Calculations for Multi-Dimensional Box
concatxy

Concatenate x,y Coordinate Vectors
edges

Extract Boundary Edges of a Window.
dilated.areas

Areas of Morphological Dilations
diameter.owin

Diameter of a Window
crossdist.pp3

Pairwise distances between two different three-dimensional point patterns
closing

Morphological Closing
covering

Cover Region with Discs
headtail

First or Last Part of a Spatial Pattern
distmap.owin

Distance Map of Window
dilation

Morphological Dilation
hextess

Hexagonal Grid or Tessellation
identify.ppp

Identify Points in a Point Pattern
cut.ppp

Classify Points in a Point Pattern
crossdist

Pairwise distances
default.dummy

Generate a Default Pattern of Dummy Points
delaunay

Delaunay Triangulation of Point Pattern
distmap.ppp

Distance Map of Point Pattern
diameter

Diameter of an Object
disc

Circular Window
edit.hyperframe

Invoke Text Editor on Hyperframe
discpartarea

Area of Part of Disc
contour.im

Contour plot of pixel image
diameter.box3

Geometrical Calculations for Three-Dimensional Box
distfun

Distance Map as a Function
identify.psp

Identify Segments in a Line Segment Pattern
incircle

Find Largest Circle Inside Window
dirichletVertices

Vertices and Edges of Dirichlet Tessellation
infline

Infinite Straight Lines
dirichletAreas

Compute Areas of Tiles in Dirichlet Tessellation
is.boxx

Recognise a Multi-Dimensional Box
dirichletWeights

Compute Quadrature Weights Based on Dirichlet Tessellation
distmap.psp

Distance Map of Line Segment Pattern
distmap

Distance Map
eroded.areas

Areas of Morphological Erosions
crossdist.default

Pairwise distances between two different sets of points
is.connected

Determine Whether an Object is Connected
erosion

Morphological Erosion by a Disc
is.lpp

Test Whether An Object Is A Point Pattern on a Linear Network
is.marked

Test Whether Marks Are Present
domain

Extract the Domain of any Spatial Object
edit.ppp

Invoke Text Editor on Spatial Data
fourierbasis

Fourier Basis Functions
ellipse

Elliptical Window.
endpoints.psp

Endpoints of Line Segment Pattern
funxy

Spatial Function Class
framedist.pixels

Distance to Bounding Frame
gridweights

Compute Quadrature Weights Based on Grid Counts
grow.boxx

Add margins to box in any dimension
fardist

Farthest Distance to Boundary of Window
delaunayDistance

Distance on Delaunay Triangulation
edges2triangles

List Triangles in a Graph
discretise

Safely Convert Point Pattern Window to Binary Mask
gridcentres

Rectangular grid of points
edges2vees

List Dihedral Triples in a Graph
harmoniseLevels

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

Add margins to rectangle
flipxy

Exchange X and Y Coordinates
inside.boxx

Test Whether Points Are Inside A Multidimensional Box
inside.owin

Test Whether Points Are Inside A Window
ewcdf

Weighted Empirical Cumulative Distribution Function
hist.funxy

Histogram of Values of a Spatial Function
has.close

Check Whether Points Have Close Neighbours
dirichlet

Dirichlet Tessellation of Point Pattern
im

Create a Pixel Image Object
extrapolate.psp

Extrapolate Line Segments to Obtain Infinite Lines
is.connected.ppp

Determine Whether a Point Pattern is Connected
is.convex

Test Whether a Window is Convex
markstat

Summarise Marks in Every Neighbourhood in a Point Pattern
is.multitype.ppp

Test Whether A Point Pattern is Multitype
is.owin

Test Whether An Object Is A Window
eval.im

Evaluate Expression Involving Pixel Images
matchingdist

Distance for a Point Pattern Matching
harmonise.im

Make Pixel Images Compatible
im.apply

Apply Function Pixelwise to List of Images
intensity

Intensity of a Dataset or a Model
interp.colourmap

Interpolate smoothly between specified colours
intensity.ppp

Empirical Intensity of Point Pattern
invoke.metric

Perform Geometric Task using a Specified Metric
hist.im

Histogram of Pixel Values in an Image
erosionAny

Morphological Erosion of Windows
invoke.symbolmap

Plot Data Using Graphics Symbol Map
is.empty

Test Whether An Object Is Empty
lut

Lookup Tables
is.im

Test Whether An Object Is A Pixel Image
marks

Marks of a Point Pattern
discs

Union of Discs
is.ppp

Test Whether An Object Is A Point Pattern
intensity.psp

Empirical Intensity of Line Segment Pattern
is.rectangle

Determine Type of Window
marks.psp

Marks of a Line Segment Pattern
harmonise.owin

Make Windows Compatible
methods.ppx

Methods for Multidimensional Space-Time Point Patterns
methods.unitname

Methods for Units
marks.tess

Marks of a Tessellation
layerplotargs

Extract or Replace the Plot Arguments of a Layered Object
im.object

Class of Images
interp.im

Interpolate a Pixel Image
intersect.boxx

Intersection Of Boxes Of Arbitrary Dimension
methods.layered

Methods for Layered Objects
lengths_psp

Lengths of Line Segments
imcov

Spatial Covariance of a Pixel Image
nndist

Nearest neighbour distances
methods.pp3

Methods for three-dimensional point patterns
levelset

Level Set of a Pixel Image
plot.quadratcount

Plot Quadrat Counts
nestsplit

Nested Split
methods.distfun

Geometrical Operations for Distance Functions
integral.density

Compute Integral of One-Dimensional Kernel Density Estimate.
harmonise

Make Objects Compatible
nncross

Nearest Neighbours Between Two Patterns
intensity.ppx

Intensity of a Multidimensional Space-Time Point Pattern
methods.box3

Methods for Three-Dimensional Box
integral.im

Integral of a Pixel Image
hotrod

Heat Kernel for a One-Dimensional Rod
intersect.owin

Intersection, Union or Set Subtraction of Windows
methods.boxx

Methods for Multi-Dimensional Box
nndist.pp3

Nearest neighbour distances in three dimensions
hyperframe

Hyper Data Frame
methods.funxy

Methods for Spatial Functions
nearestValue

Image of Nearest Defined Pixel Value
intersect.tess

Intersection of Two Tessellations
is.marked.ppp

Test Whether A Point Pattern is Marked
multiplicity.ppp

Count Multiplicity of Duplicate Points
nearest.raster.point

Find Pixel Nearest to a Given Point
nnfun

Nearest Neighbour Index Map as a Function
nnmap

K-th Nearest Point 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
nnmark

Mark of Nearest Neighbour
nnwhich

Nearest neighbour
padimage

Pad the Border of a Pixel Image
pairdist

Pairwise distances
is.subset.owin

Determine Whether One Window is Contained In Another
opening

Morphological Opening
pairdist.ppp

Pairwise distances
intensity.quadratcount

Intensity Estimates Using Quadrat Counts
overlap.owin

Compute Area of Overlap
nnwhich.pp3

Nearest neighbours in three dimensions
layered

Create List of Plotting Layers
mean.im

Mean and Median of Pixel Values in an Image
periodify

Make Periodic Copies of a Spatial Pattern
pairdist.ppx

Pairwise Distances in Any Dimensions
plot.quad

Plot a Spatial Quadrature Scheme
is.multitype

Test whether Object is Multitype
owin

Create a Window
owin.object

Class owin
nnwhich.ppx

Nearest Neighbours in Any Dimensions
mergeLevels

Merge Levels of a Factor
maxnndist

Compute Minimum or Maximum Nearest-Neighbour Distance
mean.ewcdf

Mean of Empirical Cumulative Distribution Function
layout.boxes

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

Pairwise distances between line segments
perimeter

Perimeter Length of Window
metric.object

Distance Metric
midpoints.psp

Midpoints of Line Segment Pattern
persp.im

Perspective Plot of Pixel Image
nndist.ppx

Nearest Neighbour Distances in Any Dimensions
pixelquad

Quadrature Scheme Based on Pixel Grid
plot.anylist

Plot a List of Things
nncross.pp3

Nearest Neighbours Between Two Patterns in 3D
plot.colourmap

Plot a Colour Map
nncross.ppx

Nearest Neighbours Between Two Patterns in Any Dimensions
pixellate

Convert Spatial Object to Pixel Image
plot.hyperframe

Plot Entries in a Hyperframe
nsegments

Number of Line Segments in a Line Segment Pattern
pixellate.owin

Convert Window to Pixel Image
plot.pp3

Plot a Three-Dimensional Point Pattern
plot.onearrow

Plot an Arrow
plot.ppp

plot a Spatial Point Pattern
nearestsegment

Find Line Segment Nearest to Each Point
nobjects

Count Number of Geometrical Objects in a Spatial Dataset
quadrats

Divide Region into Quadrats
plot.owin

Plot a Spatial Window
nndist.psp

Nearest neighbour distances between line segments
npoints

Number of Points in a Point Pattern
polartess

Tessellation Using Polar Coordinates
pairdist.default

Pairwise distances
plot.symbolmap

Plot a Graphics Symbol Map
plot.solist

Plot a List of Spatial Objects
plot.splitppp

Plot a List of Point Patterns
owin2mask

Convert Window to Binary Mask under Constraints
pp3

Three Dimensional Point Pattern
nvertices

Count Number of Vertices
pairdist.pp3

Pairwise distances in Three Dimensions
pHcolourmap

Colour Map for pH Values
pixellate.ppp

Convert Point Pattern to Pixel Image
rexplode

Explode a Point Pattern by Displacing Duplicated Points
pppdist

Distance Between Two Point Patterns
pppmatching

Create a Point Matching
project2segment

Move Point To Nearest Line
pixellate.psp

Convert Line Segment Pattern to Pixel Image
plot.tess

Plot a Tessellation
print.ppp

Print Brief Details of a Point Pattern Dataset
project2set

Find Nearest Point in a Region
print.psp

Print Brief Details of a Line Segment Pattern Dataset
perspPoints

Draw Points or Lines on a Surface Viewed in Perspective
print.quad

Print a Quadrature Scheme
split.hyperframe

Divide Hyperframe Into Subsets and Reassemble
quadratcount

Quadrat counting for a point pattern
pixelcentres

Extract Pixel Centres as Point Pattern
rotate.ppp

Rotate a Point Pattern
print.im

Print Brief Details of an Image
plot.textstring

Plot a Text String
requireversion

Require a Specific Version of a Package
plot.pppmatching

Plot a Point Matching
plot.psp

plot a Spatial Line Segment Pattern
relevel.im

Reorder Levels of a Factor-Valued Image or Pattern
print.owin

Print Brief Details of a Spatial Window
plot.texturemap

Plot a Texture Map
plot.imlist

Plot a List of Images
plot.im

Plot a Pixel Image
ppp

Create a Point Pattern
progressreport

Print Progress Reports
subset.psp

Subset of Line Segment Satisfying A Condition
psp2mask

Convert Line Segment Pattern to Binary Pixel Mask
ppp.object

Class of Point Patterns
quantile.im

Sample Quantiles of Pixel Image
quad.object

Class of Quadrature Schemes
selfcrossing.psp

Crossing Points in a Line Segment Pattern
round.ppp

Apply Numerical Rounding to Spatial Coordinates
plot.layered

Layered Plot
quantilefun

Quantile Function
plot.listof

Plot a List of Things
rotate

Rotate
plot.yardstick

Plot a Yardstick or Scale Bar
pointsOnLines

Place Points Evenly Along Specified Lines
quasirandom

Quasirandom Patterns
shift.owin

Apply Vector Translation To Window
superimpose

Superimpose Several Geometric Patterns
quantess

Quantile Tessellation
rQuasi

Generate Quasirandom Point Pattern in Given Window
quantile.ewcdf

Quantiles of Weighted Empirical Cumulative Distribution Function
rescale.owin

Convert Window to Another Unit of Length
raster.x

Cartesian Coordinates for a Pixel Raster
solist

List of Two-Dimensional Spatial Objects
rectdistmap

Distance Map Using Rectangular Distance Metric
rescale.psp

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

Convert Window Back To Rectangle
triangulate.owin

Decompose Window into Triangles
rounding

Detect Numerical Rounding
shift.im

Apply Vector Translation To Pixel Image
reflect

Reflect In Origin
rescale.ppp

Convert Point Pattern to Another Unit of Length
regularpolygon

Create A Regular Polygon
summary.ppp

Summary of a Point Pattern Dataset
rotate.infline

Rotate or Shift Infinite Lines
pppmatching.object

Class of Point Matchings
rotate.im

Rotate a Pixel Image
rotate.owin

Rotate a Window
rjitter

Random Perturbation of a Point Pattern
selfcut.psp

Cut Line Segments Where They Intersect
sidelengths.owin

Side Lengths of Enclosing Rectangle of a Window
summary.psp

Summary of a Line Segment Pattern Dataset
restrict.colourmap

Restrict a Colour Map to a Subset of Values
spokes

Spokes pattern of dummy points
rlinegrid

Generate grid of parallel lines with random displacement
ppx

Multidimensional Space-Time Point Pattern
psp

Create a Line Segment Pattern
scaletointerval

Rescale Data to Lie Between Specified Limits
psp.object

Class of Line Segment Patterns
sessionLibs

Print Names and Version Numbers of Libraries Loaded
rsyst

Simulate systematic random point pattern
unstack.solist

Unstack Each Spatial Object in a List of Objects
split.ppx

Divide Multidimensional Point Pattern into Sub-patterns
shift

Apply Vector Translation
run.simplepanel

Run Point-and-Click Interface
rotate.psp

Rotate a Line Segment Pattern
quadscheme

Generate a Quadrature Scheme from a Point Pattern
setcov

Set Covariance of a Window
runifrect

Generate N Uniform Random Points in a Rectangle
quadscheme.logi

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

Convert Pixel Image to Another Unit of Length
scalardilate

Apply Scalar Dilation
solutionset

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

Apply Vector Translation To Point Pattern
tilenames

Names of Tiles in a Tessellation
solapply

Apply a Function Over a List and Obtain a List of Objects
spatstat.options

Internal Options in Spatstat Package
tess

Create a Tessellation
spatdim

Spatial Dimension of a Dataset
spatstat.geom-deprecated

Deprecated spatstat.geom functions
with.hyperframe

Evaluate an Expression in Each Row of a Hyperframe
trim.rectangle

Cut margins from rectangle
simplify.owin

Approximate a Polygon by a Simpler Polygon
rescale

Convert dataset to another unit of length
spatstat.geom-internal

Internal spatstat.geom functions
symbolmap

Graphics Symbol Map
split.im

Divide Image Into Sub-images
shift.psp

Apply Vector Translation To Line Segment Pattern
where.max

Find Location of Maximum in a Pixel Image
rgbim

Create Colour-Valued Pixel Image
unnormdensity

Weighted kernel smoother
timed

Record the Computation Time
ripras

Estimate window from points alone
unstack.ppp

Separate Multiple Columns of Marks
text.ppp

Add Text Labels to Spatial Pattern
simplepanel

Simple Point-and-Click Interface Panels
uniquemap.ppp

Map Duplicate Entries to Unique Entries
summary.quad

Summarizing a Quadrature Scheme
transformquantiles

Transform the Quantiles
union.quad

Union of Data and Dummy Points
summary.splitppp

Summary of a Split Point Pattern
subset.hyperframe

Subset of Hyperframe Satisfying A Condition
scanpp

Read Point Pattern From Data File
texturemap

Texture Map
summary.solist

Summary of a List of Spatial Objects
split.ppp

Divide Point Pattern into Sub-patterns
square

Square Window
whist

Weighted Histogram
stratrand

Stratified random point pattern
summary.distfun

Summarizing a Function of Spatial Location
summary.anylist

Summary of a List of Things
transmat

Convert Pixel Array Between Different Conventions
summary.im

Summarizing a Pixel Image
shift.ppx

Apply Vector Translation To Box Or Point Pattern In Arbitrary Dimension
uniquemap.default

Map Duplicate Entries to Unique Entries
whichhalfplane

Test Which Side of Infinite Line a Point Falls On
tiles.empty

Check For Empty Tiles in a Tessellation
test.crossing.psp

Check Whether Segments Cross
spatstat.geom-package

The spatstat.geom Package
volume

Volume of an Object
weighted.median

Weighted Median, Quantiles or Variance
summary.listof

Summary of a List of Things
summary.owin

Summary of a Spatial Window
tile.areas

Compute Areas of Tiles in a Tessellation
timeTaken

Extract the Total Computation Time
tiles

Extract List of Tiles in a Tessellation
unitname

Name for Unit of Length
unmark

Remove Marks
tweak.colourmap

Change Colour Values in a Colour Map
venn.tess

Tessellation Delimited by Several Sets
tileindex

Determine Which Tile Contains Each Given Point
textureplot

Plot Image or Tessellation Using Texture Fill
subset.ppp

Subset of Point Pattern Satisfying A Condition
update.symbolmap

Update a Graphics Symbol Map.
unique.ppp

Extract Unique Points from a Spatial Point Pattern
vertices

Vertices of a Window
yardstick

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

Rounding of Pixel Values