pald {pald} | R Documentation |
Partitioned Local Depth (PaLD)
Description
A wrapper function which computes the cohesion matrix, local depths, community graphs and provides a plot of the community graphs with connected components of the graph of strong ties colored by connected component.
Usage
pald(
d,
show_plot = TRUE,
show_labels = TRUE,
only_strong = FALSE,
emph_strong = 2,
edge_width_factor = 50,
colors = NULL,
layout = NULL,
...
)
Arguments
d |
A matrix of pairwise distances or a |
show_plot |
Set to |
show_labels |
Set to |
only_strong |
Set to |
emph_strong |
Numeric. The numeric factor by which the edge widths of
strong ties are emphasized in the display; the default is |
edge_width_factor |
Numeric. Modify to change displayed edge widths.
Default: |
colors |
A vector of display colors, if none is given a default list (of length 24) is provided. |
layout |
A layout for the graph. If none is specified, FR-graph drawing algorithm is used. |
... |
Optional parameters to pass to the
|
Details
This function re-computes the cohesion matrix each time it is run.
To avoid unnecessary computation when creating visualizations, use the
function cohesion_matrix
to compute the cohesion matrix which may then
be taken as input for local_depths
, strong_threshold
,
cohesion_strong
, community_graphs
, and plot_community_graphs
.
For further details regarding each component, see the documentation for
each of the above functions.
Value
A list consisting of:
-
C
: the matrix of cohesion values -
local_depths
: a vector of local depths -
clusters
: a vector of (community) cluster labels -
threshold
: the threshold above which cohesion is considered particularly strong -
C_strong
: the thresholded matrix of cohesion values -
G
: the graph whose edges weights are mutual cohesion -
G_strong
: the weighted graph whose edges are those for which cohesion is particularly strong -
layout
: a FR force-directed layout associated with G
References
K. S. Berenhaut, K. E. Moore, R. L. Melvin, A social perspective on perceived distances reveals deep community structure. Proc. Natl. Acad. Sci., 119(4), 2022.
Examples
D <- dist(exdata2)
pald_results <- pald(D)
pald_results$local_depths
pald(D, layout = as.matrix(exdata2), show_labels = FALSE)
C <- cohesion_matrix(D)
local_depths(C)
plot_community_graphs(C, layout = as.matrix(exdata2), show_labels = FALSE)
pald_languages <- pald(cognate_dist)
head(pald_languages$local_depths)