use_iso_countries | R Documentation |
The IEA uses full country names, but it is more concise to use the 3-letter ISO abbreviations. This function replaces the full country names with ISO abbreviations where possible.
use_iso_countries(
.iea_df,
override_df = IEATools::override_iso_codes_df,
country = IEATools::iea_cols$country,
pfu_code = IEATools::country_concordance_cols$pfu_code,
iea_name = IEATools::country_concordance_cols$iea_name,
override_suffix = "...override"
)
.iea_df |
A data frame containing a |
override_df |
A data frame containing columns named |
country |
The name of the country column in |
pfu_code , iea_name |
See |
override_suffix |
A suffix added to override columns. Default is "...override". |
Internally, the countrycode
package is used for ISO codes where possible.
Optionally, an override_df
can be specified.
override_df
should contain columns pfu_code
(for 3-letter ISO codes) and iea_name
for country names.
If neither the countrycode
package nor override_df
contain a matching country
name,
the country
column is left untouched.
By default, special cases are considered via the override_df
argument.
The default value of override_df
sets codes for China and Hong Kong,
as well as World X bunkers.
.iea_df
with 3-letter ISO country abbreviations in the country
column.
sample_iea_data_path() %>%
iea_df() %>%
rename_iea_df_cols() %>%
use_iso_countries()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.