Takes an association pairs dataframe and collapses it to compute each variable/ids average strength. Used for normalizing pairs or investigating patterns in average strength.

gather_avg_strength(association_pairs, strength_column = "strength")

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).

strength_column

Id of column that encodes the strength of the associations for pairs

Value

Dataframe with id and avg_strength columns for each unique variable in association pairs

Examples

gather_avg_strength(virus_net)
#> # A tibble: 586 x 2 #> id avg_strength #> <chr> <dbl> #> 1 Adelaide River virus 0.00137 #> 2 Adeno-associated virus-1 0.00379 #> 3 Adeno-associated virus-2 0.00413 #> 4 Adeno-associated virus-5 0.00492 #> 5 African green monkey polyomavirus 0.00391 #> 6 African green monkey simian foamy virus 0.000166 #> 7 African horse sickness virus 0.00110 #> 8 African swine fever virus 0.000700 #> 9 Aichi virus 0.00492 #> 10 Akabane virus 0.00236 #> # … with 576 more rows