View source: R/calculate_hpop_billion.R
calculate_hpop_billion_change | R Documentation |
calculate_hpop_billion_change()
uses the standard HPOP methodology to calculate
the Billions estimates for all end years. It is used within calculate_hpop_billion()
to calculate the Billion and return the data in long format. Called by itself,
it expects a column of changes to be passed in, and
returns the Billion for all end_year
values.
calculate_hpop_billion_change(
df,
change = "contribution_percent",
contribution_col = "contribution",
population = "population",
end_year = 2019:2025,
pop_year = 2025,
scenario_col = NULL,
ind_ids = billion_ind_codes("hpop")
)
df |
Data frame in long format, where 1 row corresponds to a specific country, year, and indicator. |
change |
Column name of column(s) with change value |
contribution_col |
Column name of column(s) to store contribution (population)
values. Must be the same length as |
population |
Column name of column to create with population figures. |
end_year |
End year(s) for contribution calculation, defaults to 2019 to 2025. |
pop_year |
Year used to pull in HPOP populations, defaults to 2025. |
scenario_col |
Column name of column with scenario identifiers. Useful for calculating contributions on data in long format rather than wide format. |
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
|
Other hpop:
add_hpop_populations()
,
calculate_hpop_billion()
,
calculate_hpop_contributions()
,
hpop_df
,
transform_hpop_data()
,
transform_hpop_single()
,
untransform_hpop_data()
,
untransform_hpop_single()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.