View source: R/calculate_contribution_sums.R
calculate_contribution_sums | R Documentation |
Calculates global or regional sums for billions contributions for the UHC, HPOP, and HEP billions.
calculate_contribution_sums(
df,
billion = c("uhc", "hpop", "hep"),
sum_years,
sum_type = c("global", "regional"),
source = sprintf("WHO DDI calculation, %s", format(Sys.Date(), "%B %Y")),
scenario_col = NULL,
contribution_col = "contribution"
)
df |
A data frame |
billion |
One of uhc, hpop, and hep. The billion for which we want to find global sums. |
sum_years |
The year(s) for which we want to sum the billions contributions. |
sum_type |
Allows you to select between global and regional sums. |
source |
The source for the calculated billions. |
scenario_col |
Column name of column with scenario identifiers. Useful for calculating contributions on data in long format rather than wide format. |
contribution_col |
Column name of column(s) to store contribution (population) values. |
full_data is expected to have the values of the billions calculations per country already computed. In this example, we're calculating the global contributions for the HPOP billion for 2025.
A data frame with the global sums for the relevant billion. Does not include rows from the original data frame.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.