Skip to contents

This function tests if a set of nodes form a connected set on a gData or gGraph object.

Usage

# S4 method for class 'gData'
isConnected(object, ...)

# S4 method for class 'gGraph'
isConnected(object, ...)

Arguments

object

a gData or gGraph object

...

other arguments passed to other methods.

Value

a single logical value, being TRUE if nodes form a connected set.

Details

This function is a method for both gData and gGraph objects. For a gData object, it tests if all the nodes in the object form a connected set on the associated gGraph object. For a gGraph object, it tests if all nodes in the graph form a connected set. Use areConnected() if you want to test if a specific subset of nodes form a connected set.

See also

Other connectivity_functions: areConnected(), areNeighbours(), isReachable()

Examples

# in the world graph, there are nodes that are not connected
isConnected(worldgraph.10k)
#> [1] FALSE
# all the nodes in the hgdp gData object are connected
isConnected(hgdp)
#> [1] TRUE