
Plot a network graph
plot_network.RdVisualize an igraph or tbl_graph object using ggraph.
Usage
plot_network(
graph,
layout = "fr",
color_by = "type",
node_size = 3,
edge_alpha = 0.3,
show_labels = NULL
)Arguments
- graph
An
igraphortidygraph::tbl_graphobject.- layout
Layout algorithm (default
"fr"for Fruchterman-Reingold). Seeggraph::create_layout()for options.- color_by
Vertex attribute name to map to node color (default
"type").- node_size
Base node size (default 3).
- edge_alpha
Edge transparency (default 0.3).
- show_labels
Whether to label nodes (default
TRUEfor nodes with degree >= 3, or all if graph has <= 50 nodes).
Examples
if (FALSE) { # \dontrun{
g <- build_hct_network("UNITCM_H001")
plot_network(g)
} # }