transform_hpop_data: Transform Raw Indicator Values for HPOP Billion

View source: R/transform_hpop.R

transform_hpop_dataR Documentation

Transform Raw Indicator Values for HPOP Billion

Description

transform_hpop_data() applies transformations on HPOP Billion indicators so that transformed indicator values can be used within Billions calculations. Details on the specific transformations applied can be found within the Billions methods report. Values in the transform column, if it already exists, are replaced for HPOP indicators that have data in the value_col column, otherwise the column keeps its original data.

Usage

transform_hpop_data(
  df,
  value_col = "value",
  transform_glue = "transform_{value_col}",
  ind_ids = billion_ind_codes("hpop"),
  recycle = FALSE,
  ...
)

Arguments

df

Data frame in long format, where 1 row corresponds to a specific country, year, and indicator.

value_col

Column name of column with indicator values.

transform_glue

Glue expression to be passed to glue::glue(). Defaults to 'transform_{value_col}' which will create new column names by prefixing transform_ to the original name.

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 billion_ind_codes().

recycle

Boolean to indicate if data should be recycled

...

additional parameters to to pass to recycle_data

Details

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")

Value

Data frame in long format.

See Also

Other hpop: add_hpop_populations(), calculate_hpop_billion_change(), calculate_hpop_billion(), calculate_hpop_contributions(), hpop_df, transform_hpop_single(), untransform_hpop_data(), untransform_hpop_single()


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