Skip to contents

Calculates the linear trend (slope) of annual funding amounts over years for each donor.

Usage

indicator_donor_funding_growth(flows, donors = NULL, donor_name = NULL)

Arguments

flows

A dataframe with sourceObjects, budgetYear, and amountUSD.

donors

Optional dataframe with donor names.

donor_name

Optional donor name to highlight in the plot.

Value

A list with a tibble with donor and Funding_Growth_Trend (slope of funding over years) and a plot.

Examples

result <- indicator_donor_funding_growth(flows, donor_name = "Germany")
print(result$plot)
#> `stat_bin()` using `bins = 30`. Pick better value `binwidth`.
#> Warning: Removed 154 rows containing non-finite outside the scale range (`stat_bin()`).