View source: R/calculate_hep_components.R
calculate_hep_components | R Documentation |
Currently, the Prepare and DNR indicators are already calculated in the input data, so only Prevent is calculated in this function. It takes the numerator and denominator data from the inputs and calculates the vaccination coverage per year and country for each relevant pathogen, as well as the overall Prevent score. For DNR and its components, the level_col is calculated in this function.
calculate_hep_components(
df,
scenario_col = NULL,
transform_value_col = "transform_value",
source = sprintf("WHO DDI, %s", format(Sys.Date(), "%B %Y")),
level_col = stringr::str_replace(transform_value_col, "transform_value", "level"),
hepi_start_year = 2018,
ind_ids = billion_ind_codes("hep", include_calculated = TRUE)
)
df |
Data frame in long format, where 1 row corresponds to a specific country, year, and indicator. |
scenario_col |
Column name of column with scenario identifiers. Useful for calculating contributions on data in long format rather than wide format. |
transform_value_col |
Column name of column(s) with transformed indicator values, used to calculate contributions. |
source |
Source to use if no unique source available for the calculation. |
level_col |
Column name(s) to create to hold levels data. Should be same length
as |
hepi_start_year |
First year to calculate HEP index for. |
ind_ids |
Named vector of indicator codes for input indicators to the Billion.
Although separate indicator codes can be used than the standard, they must
be supplied as a named vector where the names correspond to the output of
|
Data frame in long format.
HEP functions
add_hep_populations()
,
calculate_hep_billion()
,
hep_df
,
transform_hep_data()
,
transform_prev_cmpgn_data()
,
transform_prev_routine_data()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.