wrangle_unsd_data: Put UNSD data into billionaiRe format

wrangle_unsd_dataR Documentation

Put UNSD data into billionaiRe format

Description

wrangle_unsd_data() takes data returned from the UNSD API, which should be obtained using [goalie::sdg_data()]https://gpw13.github.io/goalie/reference/sdg_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 SDG data frame. As well, the UNSD series code is kept in the data frame until indicators_df contains UNSD codes and can convert between the two.

Usage

wrangle_unsd_data(df, source = NULL, type = NULL, scenario = NULL)

Arguments

df

A data frame in UNSD format, returned from [goalie::sdg_data()]https://gpw13.github.io/goalie/reference/sdg_data.html.

source

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

type

Character string of type to be provided to the data frame. If NULL, the type column is generated from the UNSD's Nature column. "C" and "CA" are turned to "reported", while "E" and "M" are "estimated".

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_data(), wrangle_gho_rural_urban_data(), xmart_col_types(), xmart_cols()


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