Learn R Programming

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

spatstat.geom (version 2.3-1)

Geometrical Functionality of the 'spatstat' Family

Description

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

Copy Link

Version

Install

install.packages('spatstat.geom')

Monthly Downloads

66,163

Version

2.3-1

License

GPL (>= 2)

Maintainer

Last Published

December 10th, 2021

Functions in spatstat.geom (2.3-1)

Extract.owin

Extract Subset of Window
Extract.im

Extract Subset of Image
Extract.layered

Extract or Replace Subset of a Layered Object
Extract.ppp

Extract or Replace Subset of Point Pattern
Extract.listof

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

Extract Subset of Multidimensional Point Pattern
Extract.anylist

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

Subset of Quadrature Scheme
Extract.hyperframe

Extract or Replace Subset of Hyperframe
Extract.psp

Extract Subset of Line Segment Pattern
Extract.solist

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

Extract or Replace Sub-Patterns
WindowOnly

Extract Window of Spatial Object
add.texture

Fill Plot With Texture
affine

Apply Affine Transformation
Window

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

Check Whether Image Contains NA Values
anylist

List of Objects
as.data.frame.owin

Convert Window to Data Frame
as.data.frame.im

Convert Pixel Image to Data Frame
angles.psp

Orientation Angles of Line Segments
as.box3

Convert Data to Three-Dimensional Box
Math.im

S3 Group Generic methods for images
as.boxx

Convert Data to Multi-Dimensional Box
affine.tess

Apply Geometrical Transformation To Tessellation
areaLoss

Difference of Disc Areas
Math.imlist

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

Convert Pixel Image to Function of Coordinates
as.data.frame.tess

Convert Tessellation to Data Frame
Extract.tess

Extract or Replace Subset of Tessellation
as.im

Convert to Pixel Image
MinkowskiSum

Minkowski Sum of Windows
as.data.frame.ppp

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

Coerce Line Segment Pattern to a Data Frame
Frame

Extract or Change the Containing Rectangle of a Spatial Object
affine.ppp

Apply Affine Transformation To Point Pattern
as.data.frame.hyperframe

Coerce Hyperframe to Data Frame
affine.psp

Apply Affine Transformation To Line Segment Pattern
areaGain

Difference of Disc Areas
as.hyperframe

Convert Data to Hyperframe
as.mask

Pixel Image Approximation of a Window
area.owin

Area of a Window
as.matrix.im

Convert Pixel Image to Matrix or Array
as.hyperframe.ppx

Extract coordinates and marks of multidimensional point pattern
as.owin

Convert Data To Class owin
by.ppp

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

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

Convert Pixel Image to Matrix
as.tess

Convert Data To Tessellation
as.layered

Convert Data To Layered Object
as.mask.psp

Convert Line Segment Pattern to Binary Pixel Mask
as.ppp

Convert Data To Class ppp
beachcolours

Create Colour Scheme for a Range of Numbers
border

Border Region of a Window
Replace.im

Reset Values in Subset of Image
affine.im

Apply Affine Transformation To Pixel Image
as.psp

Convert Data To Class psp
bounding.box.xy

Convex Hull of Points
boundingbox

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

Convert and Compare Colours in Different Formats
affine.owin

Apply Affine Transformation To Window
append.psp

Combine Two Line Segment Patterns
boxx

Multi-Dimensional Box
applynbd

Apply Function to Every Neighbourhood in a Point Pattern
bdist.pixels

Distance to Boundary of Window
bufftess

Buffer Distance Tessellation
as.function.owin

Convert Window to Indicator Function
as.rectangle

Window Frame
as.function.tess

Convert a Tessellation to a Function
as.solist

Convert List of Two-Dimensional Spatial Objects
closepairs

Close Pairs of Points
clickdist

Interactively Measure Distance
closepairs.pp3

Close Pairs of Points in 3 Dimensions
commonGrid

Determine A Common Spatial Domain And Pixel Resolution
clickpoly

Interactively Define a Polygon
closetriples

Close Triples of Points
closing

Morphological Closing
bdist.points

Distance to Boundary of Window
contour.im

Contour plot of pixel image
connected.tess

Connected Components of Tiles of a Tessellation
as.polygonal

Convert a Window to a Polygonal Window
covering

Cover Region with Discs
bdist.tiles

Distance to Boundary of Window
centroid.owin

Centroid of a window
boundingcircle

Smallest Enclosing Circle
cbind.hyperframe

Combine Hyperframes by Rows or by Columns
box3

Three-Dimensional Box
deltametric

Delta Metric
delaunayDistance

Distance on Delaunay Triangulation
crossdist

Pairwise distances
clickppp

Interactively Add Points
complement.owin

Take Complement of a Window
clip.infline

Intersect Infinite Straight Lines with a Window
diameter

Diameter of an Object
diameter.box3

Geometrical Calculations for Three-Dimensional Box
concatxy

Concatenate x,y Coordinate Vectors
connected.ppp

Connected Components of a Point Pattern
connected

Connected components
chop.tess

Subdivide a Window or Tessellation using a Set of Lines
default.dummy

Generate a Default Pattern of Dummy Points
coords

Extract or Change Coordinates of a Spatial or Spatiotemporal Point Pattern
crossdist.pp3

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

Pairwise distances between two different sets of points
delaunay

Delaunay Triangulation of Point Pattern
crossdist.ppp

Pairwise distances between two different point patterns
corners

Corners of a rectangle
dirichletVertices

Vertices and Edges of Dirichlet Tessellation
crossing.psp

Crossing Points of Two Line Segment Patterns
distmap.psp

Distance Map of Line Segment Pattern
crossdist.psp

Pairwise distances between two different line segment patterns
colouroutputs

Extract or Assign Colour Values in a Colour Map
edges2vees

List Dihedral Triples in a Graph
colourmap

Colour Lookup Tables
domain

Extract the Domain of any Spatial Object
clickbox

Interactively Define a Rectangle
edges2triangles

List Triangles in a Graph
gridcentres

Rectangular grid of points
ellipse

Elliptical Window.
endpoints.psp

Endpoints of Line Segment Pattern
fourierbasis

Fourier Basis Functions
compatible

Test Whether Objects Are Compatible
convexhull

Convex Hull
convexmetric

Distance Metric Defined by Convex Set
compatible.im

Test Whether Pixel Images Are Compatible
contour.imlist

Array of Contour Plots
convolve.im

Convolution of Pixel Images
dilated.areas

Areas of Morphological Dilations
dilation

Morphological Dilation
diameter.boxx

Geometrical Calculations for Multi-Dimensional Box
discretise

Safely Convert Point Pattern Window to Binary Mask
crossdist.ppx

Pairwise Distances Between Two Different Multi-Dimensional Point Patterns
convexhull.xy

Convex Hull of Points
cut.im

Convert Pixel Image from Numeric to Factor
convexify

Weil's Convexifying Operation
discs

Union of Discs
diameter.owin

Diameter of a Window
dirichletWeights

Compute Quadrature Weights Based on Dirichlet Tessellation
distfun

Distance Map as a Function
harmonise.owin

Make Windows Compatible
funxy

Spatial Function Class
distmap

Distance Map
edit.hyperframe

Invoke Text Editor on Hyperframe
edit.ppp

Invoke Text Editor on Spatial Data
grow.boxx

Add margins to box in any dimension
hotrod

Heat Kernel for a One-Dimensional Rod
has.close

Check Whether Points Have Close Neighbours
erosionAny

Morphological Erosion of Windows
cut.ppp

Classify Points in a Point Pattern
intensity.ppx

Intensity of a Multidimensional Space-Time Point Pattern
gridweights

Compute Quadrature Weights Based on Grid Counts
intensity.ppp

Empirical Intensity of Point Pattern
eval.im

Evaluate Expression Involving Pixel Images
dirichletAreas

Compute Areas of Tiles in Dirichlet Tessellation
dirichlet

Dirichlet Tessellation of Point Pattern
disc

Circular Window
hyperframe

Hyper Data Frame
im.object

Class of Images
grow.rectangle

Add margins to rectangle
distmap.owin

Distance Map of Window
duplicated.ppp

Determine Duplicated Points in a Spatial Point Pattern
fardist

Farthest Distance to Boundary of Window
edges

Extract Boundary Edges of a Window.
flipxy

Exchange X and Y Coordinates
distmap.ppp

Distance Map of Point Pattern
headtail

First or Last Part of a Spatial Pattern
intersect.tess

Intersection of Two Tessellations
inside.boxx

Test Whether Points Are Inside A Multidimensional Box
invoke.metric

Perform Geometric Task using a Specified Metric
nearestValue

Image of Nearest Defined Pixel Value
is.marked

Test Whether Marks Are Present
imcov

Spatial Covariance of a Pixel Image
nearest.raster.point

Find Pixel Nearest to a Given Point
harmonise

Make Objects Compatible
is.marked.ppp

Test Whether A Point Pattern is Marked
discpartarea

Area of Part of Disc
is.connected.ppp

Determine Whether a Point Pattern is Connected
interp.im

Interpolate a Pixel Image
interp.colourmap

Interpolate smoothly between specified colours
intensity.psp

Empirical Intensity of Line Segment Pattern
harmonise.im

Make Pixel Images Compatible
intensity.quadratcount

Intensity Estimates Using Quadrat Counts
im

Create a Pixel Image Object
im.apply

Apply Function Pixelwise to List of Images
inside.owin

Test Whether Points Are Inside A Window
incircle

Find Largest Circle Inside Window
invoke.symbolmap

Plot Data Using Graphics Symbol Map
hextess

Hexagonal Grid or Tessellation
nnwhich.ppx

Nearest Neighbours in Any Dimensions
nobjects

Count Number of Geometrical Objects in a Spatial Dataset
eroded.areas

Areas of Morphological Erosions
is.convex

Test Whether a Window is Convex
hist.funxy

Histogram of Values of a Spatial Function
marks

Marks of a Point Pattern
extrapolate.psp

Extrapolate Line Segments to Obtain Infinite Lines
ewcdf

Weighted Empirical Cumulative Distribution Function
is.connected

Determine Whether an Object is Connected
erosion

Morphological Erosion by a Disc
pairdist.ppp

Pairwise distances
infline

Infinite Straight Lines
pairdist.ppx

Pairwise Distances in Any Dimensions
hist.im

Histogram of Pixel Values in an Image
periodify

Make Periodic Copies of a Spatial Pattern
intersect.boxx

Intersection Of Boxes Of Arbitrary Dimension
intersect.owin

Intersection, Union or Set Subtraction of Windows
is.ppp

Test Whether An Object Is A Point Pattern
is.empty

Test Whether An Object Is Empty
identify.ppp

Identify Points in a Point Pattern
is.im

Test Whether An Object Is A Pixel Image
intensity

Intensity of a Dataset or a Model
integral.im

Integral of a Pixel Image
is.owin

Test Whether An Object Is A Window
identify.psp

Identify Segments in a Line Segment Pattern
marks.psp

Marks of a Line Segment Pattern
is.rectangle

Determine Type of Window
layout.boxes

Generate a Row or Column Arrangement of Rectangles.
is.linim

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

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

Create List of Plotting Layers
is.subset.owin

Determine Whether One Window is Contained In Another
layerplotargs

Extract or Replace the Plot Arguments of a Layered Object
methods.layered

Methods for Layered Objects
methods.funxy

Methods for Spatial Functions
lengths_psp

Lengths of Line Segments
is.multitype

Test whether Object is Multitype
marks.tess

Marks of a Tessellation
mean.im

Mean and Median of Pixel Values in an Image
mean.ewcdf

Mean of Empirical Cumulative Distribution Function
matchingdist

Distance for a Point Pattern Matching
levelset

Level Set of a Pixel Image
methods.unitname

Methods for Units
is.multitype.ppp

Test Whether A Point Pattern is Multitype
nnwhich

Nearest neighbour
maxnndist

Compute Minimum or Maximum Nearest-Neighbour Distance
nncross.pp3

Nearest Neighbours Between Two Patterns in 3D
nnwhich.pp3

Nearest neighbours in three dimensions
nncross

Nearest Neighbours Between Two Patterns
metric.object

Distance Metric
markstat

Summarise Marks in Every Neighbourhood in a Point Pattern
pixellate.owin

Convert Window to Pixel Image
plot.im

Plot a Pixel Image
pixellate

Convert Spatial Object to Pixel Image
plot.yardstick

Plot a Yardstick or Scale Bar
plot.imlist

Plot a List of Images
pointsOnLines

Place Points Evenly Along Specified Lines
print.ppp

Print Brief Details of a Point Pattern Dataset
lut

Lookup Tables
plot.layered

Layered Plot
plot.listof

Plot a List of Things
multiplicity.ppp

Count Multiplicity of Duplicate Points
persp.im

Perspective Plot of Pixel Image
nndist.pp3

Nearest neighbour distances in three dimensions
nnfun

Nearest Neighbour Index Map as a Function
nndist.psp

Nearest neighbour distances between line segments
npoints

Number of Points in a Point Pattern
midpoints.psp

Midpoints of Line Segment Pattern
methods.ppx

Methods for Multidimensional Space-Time Point Patterns
methods.box3

Methods for Three-Dimensional Box
methods.pp3

Methods for three-dimensional point patterns
mergeLevels

Merge Levels of a Factor
padimage

Pad the Border of a Pixel Image
pairdist

Pairwise distances
nsegments

Number of Line Segments in a Line Segment Pattern
pixelquad

Quadrature Scheme Based on Pixel Grid
methods.boxx

Methods for Multi-Dimensional Box
nncross.ppx

Nearest Neighbours Between Two Patterns in Any Dimensions
overlap.owin

Compute Area of Overlap
plot.anylist

Plot a List of Things
nndist

Nearest neighbour distances
methods.distfun

Geometrical Operations for Distance Functions
nearestsegment

Find Line Segment Nearest to Each Point
nestsplit

Nested Split
owin

Create a Window
plot.owin

Plot a Spatial Window
plot.symbolmap

Plot a Graphics Symbol Map
plot.tess

Plot a Tessellation
ppp

Create a Point Pattern
plot.onearrow

Plot an Arrow
ppp.object

Class of Point Patterns
pairdist.psp

Pairwise distances between line segments
nndist.ppx

Nearest Neighbour Distances in Any Dimensions
perimeter

Perimeter Length of Window
print.quad

Print a Quadrature Scheme
perspPoints

Draw Points or Lines on a Surface Viewed in Perspective
plot.texturemap

Plot a Texture Map
pppmatching

Create a Point Matching
print.psp

Print Brief Details of a Line Segment Pattern Dataset
quadscheme.logi

Generate a Logistic Regression Quadrature Scheme from a Point Pattern
pppdist

Distance Between Two Point Patterns
plot.textstring

Plot a Text String
quantile.ewcdf

Quantiles of Weighted Empirical Cumulative Distribution Function
nnmap

K-th Nearest Point Map
pixelcentres

Extract Pixel Centres as Point Pattern
plot.quad

Plot a Spatial Quadrature Scheme
requireversion

Require a Specific Version of a Package
progressreport

Print Progress Reports
relevel.im

Reorder Levels of a Factor-Valued Image or Pattern
rlinegrid

Generate grid of parallel lines with random displacement
rjitter

Random Perturbation of a Point Pattern
quantess

Quantile Tessellation
rotate.psp

Rotate a Line Segment Pattern
rotate.ppp

Rotate a Point Pattern
reflect

Reflect In Origin
sessionLibs

Print Names and Version Numbers of Libraries Loaded
setcov

Set Covariance of a Window
nnmark

Mark of Nearest Neighbour
opening

Morphological Opening
nvertices

Count Number of Vertices
plot.quadratcount

Plot Quadrat Counts
spatdim

Spatial Dimension of a Dataset
pairdist.default

Pairwise distances
pppmatching.object

Class of Point Matchings
owin.object

Class owin
project2segment

Move Point To Nearest Line
plot.pp3

Plot a Three-Dimensional Point Pattern
ppx

Multidimensional Space-Time Point Pattern
owin2mask

Convert Window to Binary Mask under Constraints
quantile.im

Sample Quantiles of Pixel Image
rgbim

Create Colour-Valued Pixel Image
ripras

Estimate window from points alone
rotate

Rotate
regularpolygon

Create A Regular Polygon
pairdist.pp3

Pairwise distances in Three Dimensions
pixellate.ppp

Convert Point Pattern to Pixel Image
pixellate.psp

Convert Line Segment Pattern to Pixel Image
rotate.im

Rotate a Pixel Image
round.ppp

Apply Numerical Rounding to Spatial Coordinates
plot.hyperframe

Plot Entries in a Hyperframe
plot.colourmap

Plot a Colour Map
shift.owin

Apply Vector Translation To Window
rounding

Detect Numerical Rounding
spatstat.geom-deprecated

Deprecated spatstat.geom functions
shift.ppp

Apply Vector Translation To Point Pattern
split.im

Divide Image Into Sub-images
square

Square Window
project2set

Find Nearest Point in a Region
plot.ppp

plot a Spatial Point Pattern
plot.psp

plot a Spatial Line Segment Pattern
plot.pppmatching

Plot a Point Matching
plot.splitppp

Plot a List of Point Patterns
polartess

Tessellation Using Polar Coordinates
plot.solist

Plot a List of Spatial Objects
stratrand

Stratified random point pattern
print.im

Print Brief Details of an Image
summary.ppp

Summary of a Point Pattern Dataset
quadratcount

Quadrat counting for a point pattern
timeTaken

Extract the Total Computation Time
tiles.empty

Check For Empty Tiles in a Tessellation
quad.object

Class of Quadrature Schemes
where.max

Find Location of Maximum in a Pixel Image
rescale.owin

Convert Window to Another Unit of Length
summary.psp

Summary of a Line Segment Pattern Dataset
scaletointerval

Rescale Data to Lie Between Specified Limits
print.owin

Print Brief Details of a Spatial Window
whichhalfplane

Test Which Side of Infinite Line a Point Falls On
quadrats

Divide Region into Quadrats
scanpp

Read Point Pattern From Data File
quadscheme

Generate a Quadrature Scheme from a Point Pattern
spatstat.geom-internal

Internal spatstat.geom functions
spatstat.geom-package

The spatstat.geom Package
spatstat.options

Internal Options in Spatstat Package
raster.x

Cartesian Coordinates for a Pixel Raster
runifrect

Generate N Uniform Random Points in a Rectangle
psp

Create a Line Segment Pattern
pp3

Three Dimensional Point Pattern
rescale.ppp

Convert Point Pattern to Another Unit of Length
split.ppp

Divide Point Pattern into Sub-patterns
rescale.psp

Convert Line Segment Pattern to Another Unit of Length
split.hyperframe

Divide Hyperframe Into Subsets and Reassemble
rectdistmap

Distance Map Using Rectangular Distance Metric
selfcrossing.psp

Crossing Points in a Line Segment Pattern
scalardilate

Apply Scalar Dilation
rescue.rectangle

Convert Window Back To Rectangle
texturemap

Texture Map
psp.object

Class of Line Segment Patterns
sidelengths.owin

Side Lengths of Enclosing Rectangle of a Window
selfcut.psp

Cut Line Segments Where They Intersect
quasirandom

Quasirandom Patterns
union.quad

Union of Data and Dummy Points
textureplot

Plot Image or Tessellation Using Texture Fill
spokes

Spokes pattern of dummy points
simplepanel

Simple Point-and-Click Interface Panels
split.ppx

Divide Multidimensional Point Pattern into Sub-patterns
tile.areas

Compute Areas of Tiles in a Tessellation
summary.anylist

Summary of a List of Things
subset.psp

Subset of Line Segment Satisfying A Condition
transmat

Convert Pixel Array Between Different Conventions
tileindex

Determine Which Tile Contains Each Given Point
triangulate.owin

Decompose Window into Triangles
rQuasi

Generate Quasirandom Point Pattern in Given Window
rescale

Convert dataset to another unit of length
rescale.im

Convert Pixel Image to Another Unit of Length
rotate.infline

Rotate or Shift Infinite Lines
unnormdensity

Weighted kernel smoother
summary.distfun

Summarizing a Function of Spatial Location
test.crossing.psp

Check Whether Segments Cross
summary.im

Summarizing a Pixel Image
timed

Record the Computation Time
text.ppp

Add Text Labels to Spatial Pattern
unstack.ppp

Separate Multiple Columns of Marks
transformquantiles

Transform the Quantiles
venn.tess

Tessellation Delimited by Several Sets
vertices

Vertices of a Window
unique.ppp

Extract Unique Points from a Spatial Point Pattern
rotate.owin

Rotate a Window
shift.ppx

Apply Vector Translation To Box Or Point Pattern In Arbitrary Dimension
shift.psp

Apply Vector Translation To Line Segment Pattern
simplify.owin

Approximate a Polygon by a Simpler Polygon
summary.listof

Summary of a List of Things
subset.ppp

Subset of Point Pattern Satisfying A Condition
rsyst

Simulate systematic random point pattern
solapply

Apply a Function Over a List and Obtain a List of Objects
subset.hyperframe

Subset of Hyperframe Satisfying A Condition
summary.owin

Summary of a Spatial Window
superimpose

Superimpose Several Geometric Patterns
summary.splitppp

Summary of a Split Point Pattern
trim.rectangle

Cut margins from rectangle
uniquemap.default

Map Duplicate Entries to Unique Entries
solist

List of Two-Dimensional Spatial Objects
shift

Apply Vector Translation
shift.im

Apply Vector Translation To Pixel Image
run.simplepanel

Run Point-and-Click Interface
solutionset

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

Weighted Histogram
uniquemap.ppp

Map Duplicate Entries to Unique Entries
summary.solist

Summary of a List of Spatial Objects
summary.quad

Summarizing a Quadrature Scheme
tweak.colourmap

Change Colour Values in a Colour Map
with.hyperframe

Evaluate an Expression in Each Row of a Hyperframe
symbolmap

Graphics Symbol Map
tilenames

Names of Tiles in a Tessellation
unstack.solist

Unstack Each Spatial Object in a List of Objects
tess

Create a Tessellation
update.symbolmap

Update a Graphics Symbol Map.
tiles

Extract List of Tiles in a Tessellation
volume

Volume of an Object
weighted.median

Weighted Median, Quantiles or Variance
unitname

Name for Unit of Length
unmark

Remove Marks
yardstick

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

Rounding of Pixel Values