community_graphs: Community Graphs

View source: R/pald_functions.R

community_graphsR Documentation

Community Graphs

Description

Provides the graphs whose edge weights are (mutual) cohesion, together with a graph layout.

Usage

community_graphs(c)

Arguments

c

A cohesion_matrix object, a matrix of cohesion values (see cohesion_matrix).

Details

Constructs the graphs whose edge weights are (mutual) cohesion (see cohesion_matrix), self-loops are removed. The graph G has adjacency matrix equal to the symmetrized cohesion matrix (using the entry-wise parallel minimum of C and its transpose). The graph G_strong has adjacency matrix equal to the thresholded and symmetrized cohesion matrix (see cohesion_strong). The threshold is equal to half of the average of the diagonal of the cohesion matrix (see strong_threshold).

A layout is also computed using the Fruchterman-Reingold (FR) force-directed graph drawing algorithm. As a result, it may provide a somewhat different layout each time it is run.

Value

A list consisting of:

  • G: the weighted (community) graph whose edge weights are mutual cohesion

  • G_strong: the weighted (community) graph consisting of edges for which mutual cohesion is greater than the threshold for strong ties (see strong_threshold)

  • layout: the layout, using the Fruchterman Reingold (FR) force-directed graph drawing for the graph G

Examples

C <- cohesion_matrix(dist(exdata2))
plot(community_graphs(C)$G_strong)
plot(community_graphs(C)$G_strong, layout = community_graphs(C)$layout)

pald documentation built on May 29, 2024, 11:03 a.m.