knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

To calculate the UHC Billion, there are a series of functions made available through the billionaiRe package:

Run in sequence, these can calculate the entire UHC Billion, or they can be run separately to produce different outputs as required. Details on the inputs of each function are available in their individual documentation, but below you can see the quick and easy Billions calculation done using the the sample fake UHC data provided in the package, uhc_df.

library(billionaiRe)

uhc_df %>%
  transform_uhc_data(end_year = 2023) %>%
  calculate_uhc_billion() %>%
  calculate_uhc_contribution(end_year = 2023, pop_year = 2023) %>% 
  dplyr::filter(ind %in% c("uhc_sm", "asc", "fh"),
                year == 2023)


gpw13/billionaiRe documentation built on Sept. 27, 2024, 10:05 p.m.