GraphComparison {sharp} | R Documentation |
Edge-wise comparison of two graphs
Description
Generates an igraph
object representing
the common and graph-specific edges.
Usage
GraphComparison(
graph1,
graph2,
col = c("tomato", "forestgreen", "navy"),
lty = c(2, 3, 1),
node_colour = NULL,
show_labels = TRUE,
...
)
Arguments
graph1 |
first graph. Possible inputs are: adjacency matrix, or
|
graph2 |
second graph. |
col |
vector of edge colours. The first entry of the vector defines
the colour of edges in |
lty |
vector of line types for edges. The order is defined as for
argument |
node_colour |
optional vector of node colours. This vector must contain as many entries as there are rows/columns in the adjacency matrix and must be in the same order (the order is used to assign colours to nodes). Integers, named colours or RGB values can be used. |
show_labels |
logical indicating if the node labels should be displayed. |
... |
additional arguments to be passed to |
Value
An igraph object.
See Also
Examples
# Data simulation
set.seed(1)
simul1 <- SimulateGraphical(pk = 30)
set.seed(2)
simul2 <- SimulateGraphical(pk = 30)
# Edge-wise comparison of the two graphs
mygraph <- GraphComparison(
graph1 = simul1,
graph2 = simul2
)
plot(mygraph, layout = igraph::layout_with_kk(mygraph))