Description Usage Arguments See Also Examples
This function is equivalent to facet_grid
in that it
allows for building a grid of small multiples where rows and columns
correspond to a specific data value. While facet_grid
could be used it would lead to unexpected results as it is not possible to
specify whether you are refering to a node or an edge attribute. Furthermore
facet_grid
will draw edges in panels even though the
panel does not contain both terminal nodes. facet_graph
takes care of
all of these issues, allowing you to define which data type the rows and
columns are referencing as well as filtering the edges based on the nodes in
each panel (even when nodes are not drawn).
1 2 3 |
facets |
a formula with the rows (of the tabular display) on the LHS and the columns (of the tabular display) on the RHS; the dot in the formula is used to indicate there should be no faceting on this dimension (either row or column). The formula can also be provided as a string instead of a classical formula object |
row_type, col_type |
Either |
margins |
either a logical value or a character
vector. Margins are additional facets which contain all the data
for each of the possible values of the faceting variables. If
|
scales |
Are scales shared across all facets (the default,
|
space |
If |
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 |
Other ggraph-facets: facet_edges
,
facet_nodes
1 2 3 4 5 6 7 8 | 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_graph(year~popularity)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.