set_color_multilevel function

Set colors for levels of a multilevel network

Set colors for levels of a multilevel network

Set vertices and edges colors for a multilevel network. Default set to blue (higher level) and red (lower level).

set_color_multilevel(x, color.true = "blue", color.false = "red", V.alpha = 0.7, E.alpha = 0.7)

Arguments

  • x: a graph object. Must be a multilevel network.
  • color.true: a character. The color to be chosen for the higher level (attribute type set to TRUE).
  • color.false: a character. The color to be chosen for the lower level (attribute type set to FALSE).
  • V.alpha: numeric. The factor modifying the opacity alpha for the vertices; typically in [0,1].
  • E.alpha: numeric. The factor modifying the opacity alpha for the edges; typically in [0,1].

Returns

A graph object. A multilevel network with an added color

vertex attribute vector and a color edge attribute vector.

Examples

# Check whether a graph is multilevel is_multilevel(linked_sim) # Set the colors for each level linked_sim <- set_color_multilevel(linked_sim)

Author(s)

Neylson Crepalde, neylsoncrepalde@gmail.com