is.connected: Determine Whether an Object is Connected

View source: R/connected.R

is.connectedR Documentation

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)

\spatstatAuthors

.

See Also

connected, is.connected.ppp.

Examples

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

spatstat.geom documentation built on Sept. 18, 2024, 9:08 a.m.