Skip to contents

Calculates 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, and amountUSD.

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

Value

A list with a tibble with donor, recipient, and DonorRecipient_Stability_Index and a plot.

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