| facet_nodes {ggraph} | R Documentation |
This function is equivalent to facet_wrap but only
facets nodes. Edges are drawn if their terminal nodes are both present in a
panel.
facet_nodes(facets, nrow = NULL, ncol = NULL, scales = "fixed", shrink = TRUE, labeller = "label_value", as.table = TRUE, switch = NULL, drop = TRUE, dir = "h", strip.position = "top")
facets |
A set of variables or expressions quoted by For compatibility with the classic interface, can also be a formula or character vector. Use either a one sided formula, '~a
|
nrow |
Number of rows and columns. |
ncol |
Number of rows and columns. |
scales |
Should scales be fixed ( |
shrink |
If |
labeller |
A function that takes one data frame of labels and
returns a list or data frame of character vectors. Each input
column corresponds to one factor. Thus there will be more than
one with formulae of the type |
as.table |
If |
switch |
By default, the labels are displayed on the top and
right of the plot. If |
drop |
If |
dir |
Direction: either |
strip.position |
By default, the labels are displayed on the top of
the plot. Using |
Other ggraph-facets: facet_edges,
facet_graph
library(igraph)
gr <- graph_from_data_frame(highschool)
V(gr)$popularity <- as.character(cut(degree(gr, mode = 'in'), breaks = 3,
labels = c('low', 'medium', 'high')))
ggraph(gr) +
geom_edge_link() +
geom_node_point() +
facet_nodes(~popularity)