Skip to contents

This function computes graph summaries coreness, connected components, and personalized PageRank for an interaction_model. It adds these summaries to the row and column universes of the input interaction_model.

Usage

add_graph_summaries(
  im_input,
  row_key = NULL,
  col_key = NULL,
  tib_with_weights = NULL
)

Arguments

im_input

An interaction_model object containing an interaction tibble, row universe, and column universe.

row_key

The column name in the row universe that corresponds to the node names in the graph.

col_key

The column name in the column universe that corresponds to the node names in the graph.

tib_with_weights

A tibble containing node weights for personalized PageRank calculation.

Value

The input interaction_model object with added graph summaries in the row and column universes.

Examples

im = make_interaction_model(all_packages, ~Package*Imports, parse_text = TRUE, to_lower = FALSE)
row_key = "Package"
col_key = "token"
tib_with_weights = all_packages |> dplyr::mutate(weights = nchar(Package)) |> dplyr::select(Package, weights)
add_graph_summaries(im, row_key, col_key, tib_with_weights)
#> Error in add_graph_summaries(im, row_key, col_key, tib_with_weights): object 'im' not found