Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

is.connected

Determine Whether an Object is Connected


Description

Determine whether an object is topologically connected.

Usage

is.connected(X, ...)

## Default S3 method:
is.connected(X, ...)

Arguments

X

A spatial object such as a pixel image (object of class "im"), or a window (object of class "owin").

...

Arguments passed to connected to determine the connected components.

Details

The command is.connected(X) returns TRUE if the object X consists of a single, topologically-connected piece, and returns FALSE if X consists of several pieces which are not joined together.

The function is.connected is generic. The default method is.connected.default works for many classes of objects, including windows (class "owin") and images (class "im"). There is a method for point patterns, described in is.connected.ppp.

Value

A logical value.

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner r.turner@auckland.ac.nz and Ege Rubak rubak@math.aau.dk.

See Also

Examples

d <- distmap(cells, dimyx=256)
  X <- levelset(d, 0.07)
  plot(X)
  is.connected(X)

spatstat.geom

Geometrical Functionality of the 'spatstat' Family

v2.1-0
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Tilman Davies [ctb], Ute Hahn [ctb], Abdollah Jalilian [ctb], Sebastian Meyer [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Waagepetersen [ctb]
Initial release
2021-04-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.