Learn R Programming

grapherator (version 1.0.0)

addEdgesToPlot: Highlight edges in graph.

Description

Highlights edges in coordinate plot.

Usage

addEdgesToPlot(x, g, edge.list, ...)

Arguments

x

[ggplot] Coordinate plot generated via plot.grapherator.

g

[grapherator] Graph.

edge.list

[matrix] Matrix of edges (each column is one edge).

...

[any] Arguments passed down to geom_segment.

Value

[ggplot] Modified x.

Examples

Run this code
# NOT RUN {
g = graph(0, 100)
g = addNodes(g, n = 10, generator = addNodesUniform)
g = addEdges(g, generator = addEdgesComplete)
pl = plot(g)$pl.coords
el = matrix(c(1, 2, 1, 3, 4, 5, 3, 4), nrow = 2L)
pl = addEdgesToPlot(pl, g, el)
print(pl)
# }

Run the code above in your browser using DataLab