Skip to contents

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

Value

Data frame in long format.

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