View source: R/add_hpop_populations.R
add_hpop_populations | R Documentation |
add_hpop_populations()
adds relevant populations to each HPOP Billion indicator
and country, so these can be used to calculate indicator-level contributions
to the HPOP Billion. The column specified by population
will be generated and
filled with relevant populations for that country and indicator. If the column
already exists, only missing values will be replaced by the function.
add_hpop_populations(
df,
population = "population",
pop_year = 2025,
ind_ids = billion_ind_codes("hpop")
)
df |
Data frame in long format, where 1 row corresponds to a specific country, year, and indicator. |
population |
Column name of column to create with population figures. |
pop_year |
Year used to pull in HPOP populations, defaults to 2025. |
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
|
For more details on the HPOP Billion calculation process and how this function ties in with the rest, see the vignette:
vignette("hpop", package = "billionaiRe")
Data frame in long format.
Add populations
add_hep_populations()
,
add_populations()
,
pop_links
Other hpop:
calculate_hpop_billion_change()
,
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.