Highlights selected nodes in an igraph object by changing their label, fill color, and/or outline color.
The function modifies node attributes and visualizes the result using plot_Net().
Usage
highlight_nodes(
graph,
nodes,
method = c("label", "fill", "outline"),
label_color = "darkred",
highlight_fill_color = "orange",
highlight_frame_color = "darkblue",
background_color = "gray",
...
)Arguments
- graph
An
igraphobject or adata.framerepresenting a symbolic edge list. If adata.frame, it should have at least two columns specifying source and target nodes.- nodes
A character vector of node names to highlight.
- method
Character vector specifying how to highlight the nodes. One or more of:
"label","fill","outline".- label_color
Color for highlighted node labels. Used only if
"label"is inmethod. Default is"darkred".- highlight_fill_color
Fill color for highlighted nodes. Used only if
"fill"is inmethod. Default is"orange".- highlight_frame_color
Outline color for highlighted nodes. Used only if
"outline"is inmethod. Default is"darkblue".- background_color
Fill or frame color for non-highlighted nodes. Default is
"gray".- ...
Additional arguments passed to
plot_Net().
