wrangle_gho_data: Put GHO data into billionaiRe format

View source: R/wrangle_data.R

wrangle_gho_dataR Documentation

Put GHO data into billionaiRe format

Description

wrangle_gho_data takes data returned from the GHO OData API, which should be obtained using [ghost:gho_data()]https://gpw13.github.io/ghost/reference/gho_data.html, and transforms it into data that is ready to be put into the xMart database and used within the billionaiRe package. Currently, providing source and type inputs these values into the entire data frame, so does not work if multiple indicators have been loaded into the GHO data frame.

Usage

wrangle_gho_data(df, source = NULL, type = NULL, ind = NULL, scenario = NULL)

Arguments

df

A data frame in GHO format, returned from [ghost:gho_data()]https://gpw13.github.io/ghost/reference/gho_data.html.

source

Character string of source to be provided to the data frame if the source is not already available in the GHO. If NULL, the source column is generated from the GHO's DataSourceDim column.

type

Character string of type to be provided to the data frame. If NULL, the type column is just filled with NA_character_.

ind

Character string of the indicator to be provided to the data frame. If NULL, the indicator is determined by applying the convert_ind_codes function on the IndicatorCode field of the GHO data.

scenario

(Character) string of scenario to be provided to the data frame. If NULL, the scenario is set to NA_character.

Value

A data frame.

See Also

Wrangle data functions add_missing_xmart_rows(), get_data_lake_name(), get_whdh_path(), has_xmart_cols(), save_gho_backup_to_whdh(), save_wrangled_output(), wrangle_gho_rural_urban_data(), wrangle_unsd_data(), xmart_col_types(), xmart_cols()


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