Donor→Recipient: Relationship Stability Index
Source:R/indicator_donor_recipient_stability.R
indicator_donor_recipient_stability.RdCalculates how consistently a donor funds a recipient over the time series, as the proportion of years with nonzero funding between the pair.
Usage
indicator_donor_recipient_stability(
flows,
donor_recipient_pairs = NULL,
donors = NULL,
recipient_name = NULL
)Arguments
- flows
A dataframe with
sourceObjects,destinationObjects,budgetYear, andamountUSD.- donor_recipient_pairs
(optional) A dataframe of donor–recipient pairs to merge results with.
- donors
(optional used if recipient_name is provided ) A dataframe with donor names to merge with the results.
- recipient_name
(optional) the name of a specific recipient to filter the results of the function
Details
Goal: Measures how consistently a donor funds a recipient over time (share of active years).
Examples
result <- indicator_donor_recipient_stability(flows)
print(result$plot)
#> `stat_bin()` using `bins = 30`. Pick better value `binwidth`.