# is.connected

##### Determine Whether an Object is Connected

Determine whether an object is topologically connected.

##### Usage

`is.connected(X, …)`# S3 method for default
is.connected(X, …)

# S3 method for linnet
is.connected(X, …)

##### Arguments

- X
A spatial object such as a pixel image (object of class

`"im"`

), a window (object of class`"owin"`

) or a linear network (object of class`"linnet"`

).- …
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 linear networks, `is.connected.linnet`

,
described here, and a method for point patterns
described in `is.connected.ppp`

.

##### Value

A logical value.

##### See Also

##### Examples

```
# NOT RUN {
d <- distmap(cells, dimyx=256)
X <- levelset(d, 0.07)
plot(X)
is.connected(X)
# }
```

*Documentation reproduced from package spatstat, version 1.57-1, License: GPL (>= 2)*