Produces an interactive plot of nodes connected by edges scaled by the strength of association.

visualize_association_network(
  association_pairs,
  node_info,
  measure_title = "association",
  alphaDecay = 0.01,
  n_neighbors = 5,
  warn_of_mismatches = TRUE
)

Arguments

association_pairs

dataframe with columns a and b representing the ids of the variables or nodes and columns strength that is a numeric indicator of strength of association (higher = stronger).

node_info

Optional dataframe that has a column id that corresponds to the variables codded in a and b of association_pairs that contains additional info nade available on hover in visualization.

measure_title

Name of measure used to quantify strength of association between the variables.

alphaDecay

Paramter to control how fast the force-layout converges. Lower values mean a better but slower layout, higher means faster. See the d3-force docs for more info.

n_neighbors

How many neighbors for a hovered node should be shown?

warn_of_mismatches

If there are differences in the ids present in association_pairs and node_info should a warning be issued?

Value

Interactive javascript visualization of association network

Details

The plot automatically detects isolated subgraphs (groups of nodes with connections only within the group) and lays them out in a grid to avoid overlap between unrelated parts of the network.

Examples

virus_associations <- head(dplyr::arrange(virus_net, dplyr::desc(strength)), 300) visualize_association_network(virus_associations)