Learn R Programming

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

spatstat.geom (version 3.0-3)

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

License

GPL (>= 2)

Maintainer

Adrian Baddeley

Last Published

October 25th, 2022

Functions in spatstat.geom (3.0-3)

Extract.anylist

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

Extract or Replace Subset of Point Pattern
Extract.psp

Extract Subset of Line Segment Pattern
Extract.layered

Extract or Replace Subset of a Layered Object
Extract.listof

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

Extract Subset of Window
Extract.hyperframe

Extract or Replace Subset of Hyperframe
Extract.quad

Subset of Quadrature Scheme
Extract.im

Extract Subset of Image
Extract.ppx

Extract Subset of Multidimensional Point Pattern
Extract.solist

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

Extract or Replace Sub-Patterns
Extract.tess

Extract or Replace Subset of Tessellation
MinkowskiSum

Minkowski Sum of Windows
Replace.im

Reset Values in Subset of Image
Frame

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

S3 Group Generic methods for images
Window

Extract or Change the Window of a Spatial Object
add.texture

Fill Plot With Texture
Window.quad

Extract Window of Spatial Object
affine

Apply Affine Transformation
affine.psp

Apply Affine Transformation To Line Segment Pattern
anylist

List of Objects
affine.ppp

Apply Affine Transformation To Point Pattern
anyNA.im

Check Whether Image Contains NA Values
affine.im

Apply Affine Transformation To Pixel Image
affine.owin

Apply Affine Transformation To Window
areaLoss

Difference of Disc Areas
Math.imlist

S3 Group Generic methods for List of Images
as.data.frame.im

Convert Pixel Image to Data Frame
area.owin

Area of a Window
areaGain

Difference of Disc Areas
as.data.frame.owin

Convert Window to Data Frame
as.boxx

Convert Data to Multi-Dimensional Box
affine.tess

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

Coerce Hyperframe to Data Frame
as.im

Convert to Pixel Image
as.data.frame.ppp

Coerce Point Pattern to a Data Frame
as.hyperframe

Convert Data to Hyperframe
as.layered

Convert Data To Layered Object
as.ppp

Convert Data To Class ppp
as.box3

Convert Data to Three-Dimensional Box
as.psp

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

Coerce Line Segment Pattern to a Data Frame
as.matrix.im

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

Extract coordinates and marks of multidimensional point pattern
bdist.points

Distance to Boundary of Window
angles.psp

Orientation Angles of Line Segments
as.owin

Convert Data To Class owin
as.matrix.owin

Convert Pixel Image to Matrix
bdist.tiles

Distance to Boundary of Window
chop.tess

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

Convert Data To Tessellation
clickbox

Interactively Define a Rectangle
as.polygonal

Convert a Window to a Polygonal Window
bounding.box.xy

Convex Hull of Points
boundingbox

Bounding Box of a Window, Image, or Point Pattern
bdist.pixels

Distance to Boundary of Window
append.psp

Combine Two Line Segment Patterns
as.data.frame.tess

Convert Tessellation to Data Frame
closetriples

Close Triples of Points
boundingcircle

Smallest Enclosing Circle
colourmap

Colour Lookup Tables
box3

Three-Dimensional Box
applynbd

Apply Function to Every Neighbourhood in a Point Pattern
as.function.owin

Convert Window to Indicator Function
colouroutputs

Extract or Assign Colour Values in a Colour Map
connected.tess

Connected Components of Tiles of a Tessellation
boxx

Multi-Dimensional Box
contour.im

Contour plot of pixel image
as.function.tess

Convert a Tessellation to a Function
by.im

Apply Function to Image Broken Down by Factor
bufftess

Buffer Distance Tessellation
closing

Morphological Closing
as.function.im

Convert Pixel Image to Function of Coordinates
as.rectangle

Window Frame
closepairs

Close Pairs of Points
by.ppp

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

Pixel Image Approximation of a Window
crossdist.default

Pairwise distances between two different sets of points
clickppp

Interactively Add Points
as.solist

Convert List of Two-Dimensional Spatial Objects
clip.infline

Intersect Infinite Straight Lines with a Window
cbind.hyperframe

Combine Hyperframes by Rows or by Columns
default.dummy

Generate a Default Pattern of Dummy Points
as.mask.psp

Convert Line Segment Pattern to Binary Pixel Mask
closepairs.pp3

Close Pairs of Points in 3 Dimensions
complement.owin

Take Complement of a Window
crossdist.pp3

Pairwise distances between two different three-dimensional point patterns
concatxy

Concatenate x,y Coordinate Vectors
connected

Connected components
delaunay

Delaunay Triangulation of Point Pattern
beachcolours

Create Colour Scheme for a Range of Numbers
centroid.owin

Centroid of a window
colourtools

Convert and Compare Colours in Different Formats
border

Border Region of a Window
convexhull.xy

Convex Hull of Points
connected.ppp

Connected Components of a Point Pattern
covering

Cover Region with Discs
dirichlet

Dirichlet Tessellation of Point Pattern
clickdist

Interactively Measure Distance
crossdist

Pairwise distances
clickpoly

Interactively Define a Polygon
delaunayDistance

Distance on Delaunay Triangulation
deltametric

Delta Metric
contour.imlist

Array of Contour Plots
commonGrid

Determine A Common Spatial Domain And Pixel Resolution
convexify

Weil's Convexifying Operation
convexhull

Convex Hull
compatible

Test Whether Objects Are Compatible
dirichletAreas

Compute Areas of Tiles in Dirichlet Tessellation
crossdist.ppp

Pairwise distances between two different point patterns
convexmetric

Distance Metric Defined by Convex Set
crossdist.ppx

Pairwise Distances Between Two Different Multi-Dimensional Point Patterns
cut.im

Convert Pixel Image from Numeric to Factor
disc

Circular Window
dirichletVertices

Vertices and Edges of Dirichlet Tessellation
compatible.im

Test Whether Pixel Images Are Compatible
discpartarea

Area of Part of Disc
convolve.im

Convolution of Pixel Images
coords

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

Corners of a rectangle
crossdist.psp

Pairwise distances between two different line segment patterns
crossing.psp

Crossing Points of Two Line Segment Patterns
diameter.boxx

Geometrical Calculations for Multi-Dimensional Box
edit.hyperframe

Invoke Text Editor on Hyperframe
dilated.areas

Areas of Morphological Dilations
cut.ppp

Classify Points in a Point Pattern
diameter

Diameter of an Object
diameter.owin

Diameter of a Window
edit.ppp

Invoke Text Editor on Spatial Data
dilation

Morphological Dilation
distmap.owin

Distance Map of Window
dirichletWeights

Compute Quadrature Weights Based on Dirichlet Tessellation
distfun

Distance Map as a Function
discretise

Safely Convert Point Pattern Window to Binary Mask
distmap.ppp

Distance Map of Point Pattern
funxy

Spatial Function Class
distmap

Distance Map
diameter.box3

Geometrical Calculations for Three-Dimensional Box
discs

Union of Discs
gridcentres

Rectangular grid of points
grow.rectangle

Add margins to rectangle
harmonise

Make Objects Compatible
duplicated.ppp

Determine Duplicated Points in a Spatial Point Pattern
identify.psp

Identify Segments in a Line Segment Pattern
distmap.psp

Distance Map of Line Segment Pattern
domain

Extract the Domain of any Spatial Object
eroded.areas

Areas of Morphological Erosions
erosion

Morphological Erosion by a Disc
fardist

Farthest Distance to Boundary of Window
im

Create a Pixel Image Object
edges2triangles

List Triangles in a Graph
edges

Extract Boundary Edges of a Window.
inside.owin

Test Whether Points Are Inside A Window
flipxy

Exchange X and Y Coordinates
edges2vees

List Dihedral Triples in a Graph
fourierbasis

Fourier Basis Functions
has.close

Check Whether Points Have Close Neighbours
erosionAny

Morphological Erosion of Windows
ellipse

Elliptical Window.
integral.im

Integral of a Pixel Image
is.marked

Test Whether Marks Are Present
framedist.pixels

Distance to Bounding Frame
is.marked.ppp

Test Whether A Point Pattern is Marked
layout.boxes

Generate a Row or Column Arrangement of Rectangles.
hextess

Hexagonal Grid or Tessellation
hist.funxy

Histogram of Values of a Spatial Function
endpoints.psp

Endpoints of Line Segment Pattern
headtail

First or Last Part of a Spatial Pattern
lengths_psp

Lengths of Line Segments
hyperframe

Hyper Data Frame
identify.ppp

Identify Points in a Point Pattern
infline

Infinite Straight Lines
is.convex

Test Whether a Window is Convex
eval.im

Evaluate Expression Involving Pixel Images
mergeLevels

Merge Levels of a Factor
is.empty

Test Whether An Object Is Empty
ewcdf

Weighted Empirical Cumulative Distribution Function
im.apply

Apply Function Pixelwise to List of Images
im.object

Class of Images
gridweights

Compute Quadrature Weights Based on Grid Counts
intensity

Intensity of a Dataset or a Model
grow.boxx

Add margins to box in any dimension
extrapolate.psp

Extrapolate Line Segments to Obtain Infinite Lines
imcov

Spatial Covariance of a Pixel Image
methods.box3

Methods for Three-Dimensional Box
intensity.ppp

Empirical Intensity of Point Pattern
is.multitype

Test whether Object is Multitype
incircle

Find Largest Circle Inside Window
is.multitype.ppp

Test Whether A Point Pattern is Multitype
pairdist.default

Pairwise distances
pairdist.pp3

Pairwise distances in Three Dimensions
inside.boxx

Test Whether Points Are Inside A Multidimensional Box
methods.unitname

Methods for Units
intersect.owin

Intersection, Union or Set Subtraction of Windows
intersect.tess

Intersection of Two Tessellations
invoke.metric

Perform Geometric Task using a Specified Metric
harmonise.im

Make Pixel Images Compatible
invoke.symbolmap

Plot Data Using Graphics Symbol Map
metric.object

Distance Metric
pixelquad

Quadrature Scheme Based on Pixel Grid
plot.anylist

Plot a List of Things
plot.textstring

Plot a Text String
nncross

Nearest Neighbours Between Two Patterns
is.owin

Test Whether An Object Is A Window
plot.texturemap

Plot a Texture Map
intensity.ppx

Intensity of a Multidimensional Space-Time Point Pattern
harmonise.owin

Make Windows Compatible
intensity.psp

Empirical Intensity of Line Segment Pattern
print.quad

Print a Quadrature Scheme
is.ppp

Test Whether An Object Is A Point Pattern
is.linnet

Test Whether An Object Is A Linear Network
progressreport

Print Progress Reports
layered

Create List of Plotting Layers
is.lpp

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

Determine Type of Window
nncross.pp3

Nearest Neighbours Between Two Patterns in 3D
npoints

Number of Points in a Point Pattern
nsegments

Number of Line Segments in a Line Segment Pattern
is.connected

Determine Whether an Object is Connected
hist.im

Histogram of Pixel Values in an Image
is.connected.ppp

Determine Whether a Point Pattern is Connected
pairdist.psp

Pairwise distances between line segments
layerplotargs

Extract or Replace the Plot Arguments of a Layered Object
marks.tess

Marks of a Tessellation
hotrod

Heat Kernel for a One-Dimensional Rod
perimeter

Perimeter Length of Window
is.im

Test Whether An Object Is A Pixel Image
is.subset.owin

Determine Whether One Window is Contained In Another
is.linim

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

Intensity Estimates Using Quadrat Counts
periodify

Make Periodic Copies of a Spatial Pattern
nncross.ppx

Nearest Neighbours Between Two Patterns in Any Dimensions
multiplicity.ppp

Count Multiplicity of Duplicate Points
nnmap

K-th Nearest Point Map
nndist

Nearest neighbour distances
pairdist

Pairwise distances
padimage

Pad the Border of a Pixel Image
plot.layered

Layered Plot
plot.solist

Plot a List of Spatial Objects
plot.splitppp

Plot a List of Point Patterns
midpoints.psp

Midpoints of Line Segment Pattern
markstat

Summarise Marks in Every Neighbourhood in a Point Pattern
nnmark

Mark of Nearest Neighbour
print.owin

Print Brief Details of a Spatial Window
print.im

Print Brief Details of an Image
plot.listof

Plot a List of Things
pppmatching

Create a Point Matching
persp.im

Perspective Plot of Pixel Image
pppdist

Distance Between Two Point Patterns
plot.im

Plot a Pixel Image
marks

Marks of a Point Pattern
interp.colourmap

Interpolate smoothly between specified colours
matchingdist

Distance for a Point Pattern Matching
interp.im

Interpolate a Pixel Image
intersect.boxx

Intersection Of Boxes Of Arbitrary Dimension
plot.imlist

Plot a List of Images
levelset

Level Set of a Pixel Image
maxnndist

Compute Minimum or Maximum Nearest-Neighbour Distance
quad.object

Class of Quadrature Schemes
methods.funxy

Methods for Spatial Functions
lut

Lookup Tables
methods.layered

Methods for Layered Objects
quadratcount

Quadrat counting for a point pattern
plot.pp3

Plot a Three-Dimensional Point Pattern
nndist.pp3

Nearest neighbour distances in three dimensions
nndist.ppx

Nearest Neighbour Distances in Any Dimensions
nnwhich

Nearest neighbour
marks.psp

Marks of a Line Segment Pattern
nnwhich.pp3

Nearest neighbours in three dimensions
mean.ewcdf

Mean of Empirical Cumulative Distribution Function
plot.ppp

plot a Spatial Point Pattern
pairdist.ppp

Pairwise distances
polartess

Tessellation Using Polar Coordinates
mean.im

Mean and Median of Pixel Values in an Image
pairdist.ppx

Pairwise Distances in Any Dimensions
methods.boxx

Methods for Multi-Dimensional Box
raster.x

Cartesian Coordinates for a Pixel Raster
pp3

Three Dimensional Point Pattern
nearest.raster.point

Find Pixel Nearest to a Given Point
perspPoints

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

Print Brief Details of a Point Pattern Dataset
rectdistmap

Distance Map Using Rectangular Distance Metric
methods.distfun

Geometrical Operations for Distance Functions
nearestValue

Image of Nearest Defined Pixel Value
methods.pp3

Methods for three-dimensional point patterns
nndist.psp

Nearest neighbour distances between line segments
methods.ppx

Methods for Multidimensional Space-Time Point Patterns
quadscheme.logi

Generate a Logistic Regression Quadrature Scheme from a Point Pattern
nnfun

Nearest Neighbour Index Map as a Function
nnwhich.ppx

Nearest Neighbours in Any Dimensions
pixelcentres

Extract Pixel Centres as Point Pattern
nearestsegment

Find Line Segment Nearest to Each Point
nestsplit

Nested Split
plot.colourmap

Plot a Colour Map
nvertices

Count Number of Vertices
print.psp

Print Brief Details of a Line Segment Pattern Dataset
quantess

Quantile Tessellation
nobjects

Count Number of Geometrical Objects in a Spatial Dataset
plot.hyperframe

Plot Entries in a Hyperframe
rotate.im

Rotate a Pixel Image
rotate

Rotate
overlap.owin

Compute Area of Overlap
plot.pppmatching

Plot a Point Matching
rescale

Convert dataset to another unit of length
opening

Morphological Opening
owin

Create a Window
rescale.im

Convert Pixel Image to Another Unit of Length
owin.object

Class owin
plot.psp

plot a Spatial Line Segment Pattern
quantile.ewcdf

Quantiles of Weighted Empirical Cumulative Distribution Function
rotate.infline

Rotate or Shift Infinite Lines
rotate.owin

Rotate a Window
project2segment

Move Point To Nearest Line
project2set

Find Nearest Point in a Region
rescale.owin

Convert Window to Another Unit of Length
owin2mask

Convert Window to Binary Mask under Constraints
quantile.im

Sample Quantiles of Pixel Image
rescale.ppp

Convert Point Pattern to Another Unit of Length
pixellate.ppp

Convert Point Pattern to Pixel Image
pixellate

Convert Spatial Object to Pixel Image
rotate.ppp

Rotate a Point Pattern
rotate.psp

Rotate a Line Segment Pattern
pixellate.owin

Convert Window to Pixel Image
shift.owin

Apply Vector Translation To Window
scaletointerval

Rescale Data to Lie Between Specified Limits
shift.ppp

Apply Vector Translation To Point Pattern
psp

Create a Line Segment Pattern
plot.onearrow

Plot an Arrow
pixellate.psp

Convert Line Segment Pattern to Pixel Image
plot.owin

Plot a Spatial Window
psp.object

Class of Line Segment Patterns
plot.quad

Plot a Spatial Quadrature Scheme
plot.quadratcount

Plot Quadrat Counts
scanpp

Read Point Pattern From Data File
plot.symbolmap

Plot a Graphics Symbol Map
plot.tess

Plot a Tessellation
shift.ppx

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

Apply Vector Translation To Line Segment Pattern
ppp

Create a Point Pattern
ppp.object

Class of Point Patterns
quasirandom

Quasirandom Patterns
plot.yardstick

Plot a Yardstick or Scale Bar
rQuasi

Generate Quasirandom Point Pattern in Given Window
simplify.owin

Approximate a Polygon by a Simpler Polygon
pointsOnLines

Place Points Evenly Along Specified Lines
reflect

Reflect In Origin
solapply

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

Random Perturbation of a Point Pattern
regularpolygon

Create A Regular Polygon
pppmatching.object

Class of Point Matchings
ppx

Multidimensional Space-Time Point Pattern
spatstat.options

Internal Options in Spatstat Package
rescale.psp

Convert Line Segment Pattern to Another Unit of Length
rlinegrid

Generate grid of parallel lines with random displacement
rescue.rectangle

Convert Window Back To Rectangle
split.hyperframe

Divide Hyperframe Into Subsets and Reassemble
relevel.im

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

Apply Numerical Rounding to Spatial Coordinates
rounding

Detect Numerical Rounding
requireversion

Require a Specific Version of a Package
shift

Apply Vector Translation
shift.im

Apply Vector Translation To Pixel Image
quadrats

Divide Region into Quadrats
quadscheme

Generate a Quadrature Scheme from a Point Pattern
subset.hyperframe

Subset of Hyperframe Satisfying A Condition
rsyst

Simulate systematic random point pattern
run.simplepanel

Run Point-and-Click Interface
transmat

Convert Pixel Array Between Different Conventions
triangulate.owin

Decompose Window into Triangles
selfcrossing.psp

Crossing Points in a Line Segment Pattern
selfcut.psp

Cut Line Segments Where They Intersect
solist

List of Two-Dimensional Spatial Objects
solutionset

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

Create Colour-Valued Pixel Image
split.im

Divide Image Into Sub-images
split.ppp

Divide Point Pattern into Sub-patterns
ripras

Estimate window from points alone
subset.ppp

Subset of Point Pattern Satisfying A Condition
spatdim

Spatial Dimension of a Dataset
spatstat.geom-deprecated

Deprecated spatstat.geom functions
runifrect

Generate N Uniform Random Points in a Rectangle
scalardilate

Apply Scalar Dilation
where.max

Find Location of Maximum in a Pixel Image
tileindex

Determine Which Tile Contains Each Given Point
texturemap

Texture Map
sessionLibs

Print Names and Version Numbers of Libraries Loaded
whichhalfplane

Test Which Side of Infinite Line a Point Falls On
uniquemap.default

Map Duplicate Entries to Unique Entries
split.ppx

Divide Multidimensional Point Pattern into Sub-patterns
textureplot

Plot Image or Tessellation Using Texture Fill
square

Square Window
setcov

Set Covariance of a Window
summary.listof

Summary of a List of Things
stratrand

Stratified random point pattern
tile.areas

Compute Areas of Tiles in a Tessellation
summary.owin

Summary of a Spatial Window
summary.ppp

Summary of a Point Pattern Dataset
spokes

Spokes pattern of dummy points
sidelengths.owin

Side Lengths of Enclosing Rectangle of a Window
simplepanel

Simple Point-and-Click Interface Panels
summary.psp

Summary of a Line Segment Pattern Dataset
summary.splitppp

Summary of a Split Point Pattern
timed

Record the Computation Time
superimpose

Superimpose Several Geometric Patterns
union.quad

Union of Data and Dummy Points
subset.psp

Subset of Line Segment Satisfying A Condition
test.crossing.psp

Check Whether Segments Cross
summary.anylist

Summary of a List of Things
text.ppp

Add Text Labels to Spatial Pattern
spatstat.geom-internal

Internal spatstat.geom functions
spatstat.geom-package

The spatstat.geom Package
transformquantiles

Transform the Quantiles
uniquemap.ppp

Map Duplicate Entries to Unique Entries
unique.ppp

Extract Unique Points from a Spatial Point Pattern
tiles.empty

Check For Empty Tiles in a Tessellation
symbolmap

Graphics Symbol Map
update.symbolmap

Update a Graphics Symbol Map.
unstack.ppp

Separate Multiple Columns of Marks
summary.distfun

Summarizing a Function of Spatial Location
unstack.solist

Unstack Each Spatial Object in a List of Objects
tess

Create a Tessellation
with.hyperframe

Evaluate an Expression in Each Row of a Hyperframe
vertices

Vertices of a Window
summary.im

Summarizing a Pixel Image
timeTaken

Extract the Total Computation Time
unnormdensity

Weighted kernel smoother
yardstick

Text, Arrow or Scale Bar in a Diagram
trim.rectangle

Cut margins from rectangle
tweak.colourmap

Change Colour Values in a Colour Map
venn.tess

Tessellation Delimited by Several Sets
whist

Weighted Histogram
zapsmall.im

Rounding of Pixel Values
summary.quad

Summarizing a Quadrature Scheme
summary.solist

Summary of a List of Spatial Objects
tilenames

Names of Tiles in a Tessellation
tiles

Extract List of Tiles in a Tessellation
unitname

Name for Unit of Length
volume

Volume of an Object
unmark

Remove Marks
weighted.median

Weighted Median, Quantiles or Variance