| graph_prune | R Documentation |
Removes redundant relations from a graph.
graph_prune(object, ...)
## S4 method for signature 'igraph'
graph_prune(
object,
reduce = TRUE,
remove_multiple = TRUE,
remove_loops = TRUE,
...
)
object |
An igraph object (typically returned by
|
... |
Currently not used. |
reduce |
A |
remove_multiple |
A |
remove_loops |
A |
An igraph graph object.
Experimental.
The igraph and relations packages need to be installed on your machine.
N. Frerebeau
Other graph tools:
graph_create()
if (requireNamespace("igraph", quietly = TRUE) &&
requireNamespace("relations", quietly = TRUE)) {
## Seven intervals
int <- intervals(
start = c(1, 2, 3, 6, 9, 13, 17),
end = c(7, 4, 15, 14, 11, 18, 19),
calendar = CE(),
names = c("A", "B", "C", "D", "E", "F", "G")
)
## Interval graph
g <- graph_create(int, type = "interval")
plot(g)
## Stratigraphic graph
g <- graph_create(int, type = "strati")
g <- graph_prune(g) # Remove redundant relations
plot(g, layout = igraph::layout_with_sugiyama)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.