View source: R/geom-graphspace.R
| geom_graphspace | R Documentation |
geom_graphspace() adds both node and edge layers to a ggplot2
plot by calling geom_nodespace and geom_edgespace
in sequence. It is a convenience wrapper with no logic of its own; any
argument accepted by either underlying geom can be passed via
node.params or edge.params.
For independent control of node and edge layers, use
geom_nodespace and geom_edgespace directly.
geom_graphspace(mapping = NULL, node.params = list(), edge.params = list())
mapping |
An optional |
node.params |
A named list of additional arguments forwarded
to |
edge.params |
A named list of additional arguments forwarded
to |
A list of two ggplot2 layers, which ggplot2
flattens automatically when added to a plot with +.
geom_nodespace, geom_edgespace,
plotGraphSpace
library(ggplot2)
data("gtoy1", package = "RGraphSpace")
gs <- GraphSpace(gtoy1)
# Simplest use
ggplot(gs) + geom_graphspace()
# With node labels
ggplot(gs) + geom_graphspace(aes(label = nodeLabel))
# With independent node and edge customization
ggplot(gs) + geom_graphspace(
node.params = list(aes(label = nodeLabel)),
edge.params = list(curve = 0.3)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.