R: Create a connection extractor function

get_con {ggraph} | R Documentation

## Create a connection extractor function

### Description

Connections within the ggraph terminology are links between nodes that are not part of the network structure itself. In that sense connections does not affect the layout calculation in any way and will not be drawn by the standard `geom_edge_*` functions. A connection does not need to only be defined by a start and end node, but can include intermediary nodes. `get_con` helps in creating connection data by letting you specify start and end node and automatically find the shortest path within the graph structure that connects the given points. If this is not what is needed it is also possible to supply a list of vectors giving node indexes that defines a connection.

### Usage

    get_con(from = integer(), to = integer(), paths = NULL, ...)

### Arguments

`from, to` | The index of the start and end nodes for the connections
`paths` | A list of integer vectors giving the index of nodes defining connections
`...` | Additional information to be added to the final data output

### Value

A function that takes a layout_ggraph object and returns the given connections

### See Also

Other extractors: `get_edges`, `get_nodes`

[Package ggraph version 1.0.2 Index]