Creates a simple interactive network visualization that visually encodes node membership and type (if present) for a passed network.

visualize_network(
  sbm,
  node_shape_col = "type",
  node_color_col = "none",
  width = "100%",
  height = NULL
)

Arguments

sbm

Object of class sbm_network.

node_shape_col

Name of column in the nodes dataframe that should be encoded with shape of nodes in the plot

node_color_col

Name of column in the nodes dataframe that should be encoded with color of nodes in the plot. If this value is numeric (defined as more than 10 unique values that are numbers) the network will color nodes on a linear scale from the min value to the highest value.

width

Desired width for output widget.

height

Desired height for output widget.

See also

Examples

# Simulate a 3 block/cluster network with 15 nodes per block net <- sim_basic_block_network(n_blocks = 3, n_nodes_per_block = 15) # Visualize network with color encoding the blocks visualize_network(net) # Visualize network with shape encoding the true blocks visualize_network(net, node_shape_col = 'block') # Visualize network with color encoding the true blocks visualize_network(net, node_color_col = 'block')