Donors Systemic: Destination Alignment (Optimized)
Source:R/indicator_cross_donor_systemic_destination_alignment.R
indicator_cross_donor_systemic_destination_alignment.RdCalculates pairwise Jaccard similarity between donors based on their funded destinations (locations or clusters). This indicates overlap or convergence in geographic or thematic focus.
Value
A list with a tibble with columns:
- donor1
First donor in the pair.
- donor2
Second donor in the pair.
- Destination_Alignment
Jaccard similarity (0–1) of destinations.
and a plot.
Details
Goal: Measures how many destinations are common between donors relative to their total unique destinations, producing a 0–1 index.
The function works as follows:
Filters flows using
filter_flows_for_indicators()to remove flows that should not be included (e.g., parked parents, pass-throughs, out-of-boundary flows).Unnests
sourceObjectsanddestinationObjects, keeping only donors and valid destination types (Cluster,GlobalCluster,Location).Creates a list of destinations for each donor.
Computes Jaccard similarity between all unique donor pairs using precomputed lists, avoiding repeated filtering.
Returns a tibble with
donor1,donor2, andDestination_Alignment.
Examples
result <- indicator_cross_donor_systemic_destination_alignment(flows)
print(result$plot)