Add 3 letter ISO codes and MWTools-specific region codes
add_concordance_codes.Rd
Adds 3 letter ISO country codes and muscle work region codes for countries
present in the FAO's Live animals data, downloaded through the FAOSTAT
package,
usually using the MWTools::down_fao_live_animals
function.
Usage
add_concordance_codes(
.df,
concordance_path = MWTools::fao_concordance_path(),
amw_region_code_col = MWTools::conc_cols$amw_region_code_col,
hmw_region_code_col = MWTools::conc_cols$hmw_region_code_col,
country_incl_col = MWTools::conc_cols$country_incl_col,
country_code_col = MWTools::conc_cols$country_code_col,
country_name = MWTools::mw_constants$country_name
)
Arguments
- .df
The data frame containing tidied live animals data, Usually produced by calling the
tidy_fao_live_animals
function on the raw FAO data.- concordance_path
The file path to concordance information mapping the FAO country names supplied in FAOSTAT to 3-letter ISO codes, and MWTools specific region codes. Set to
MWTools::fao_concordance_path()
by default, the path to the bundled concordance information inMWTools
.- amw_region_code_col, hmw_region_code_col, country_incl_col, country_code_col
See
MWTools::conc_cols
.- country_name
Examples
live_animals_data <- read.csv(file = MWTools::amw_test_data_path()) %>%
tidy_fao_live_animals() %>%
add_concordance_codes()