Donor-Recipient Relationship Duration Index
Source:R/indicator_donor_recipient_relationship_duration.R
indicator_donor_recipient_relationship_duration.RdCalculates the normalized duration of active funding between a donor and recipient.
Usage
indicator_donor_recipient_relationship_duration(
flows,
donor_recipient_pairs = NULL,
donors = NULL,
recipient_name = NULL
)Arguments
- flows
A dataframe containing
sourceObjects,destinationObjects, andbudgetYear.- 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 columns donor, recipient, and Relationship_Duration_Index and a plot.
Examples
result <- indicator_donor_recipient_relationship_duration(flows)
print(result$plot)
#> `stat_bin()` using `bins = 30`. Pick better value `binwidth`.
#> Warning: Removed 1480 rows containing non-finite outside the scale range (`stat_bin()`).