plotPath provides a visual of a graph and the selected path.
plotPath(graph, ...)
# S4 method for class 'igraph'
plotPath(
graph,
by = NULL,
k = 1,
include = NULL,
exclude = NULL,
res.name = NULL,
focus = FALSE
)An igraph object.
Unused.
A formula specifying the path to plot. (Default: NULL)
Numeric scalar. The kth shortest path to plot.
(Default: 1)
Character vector. Nodes to cross in the path.
(Default: NULL)
Character vector. Nodes to avoid in the path.
(Default: NULL)
Character vector. Names of resources to include in
the graph. (Default: NULL)
Logical scalar. Whether the edges and nodes in the path
should be plotted. (Default: FALSE)
A ggplot2 object.
# Retrieve resource graph
graph <- ariadne()
# Plot graph for a subset of resources
plotPath(graph, res.name = c("KEGG", "WoL"))
#> Warning: Using alpha for a discrete variable is not advised.
# Plot fifth path from ko to ec
plotPath(graph, ko ~ ec, k = 5)
#> Warning: Using alpha for a discrete variable is not advised.
# Plot first path including uniref90
plotPath(graph, taxname ~ ko, include = "uniref90")
#> Warning: Using alpha for a discrete variable is not advised.
# Plot first 5 paths excluding uniref50 and uniref100
plotPath(graph, taxname ~ ko, k = 5, exclude = "uniref50")
#> Warning: Using alpha for a discrete variable is not advised.