Trim countries in FAO live animals data
trim_fao_data.Rd
This function filters out countries which have more than one instance
and aggregate regions from FAO live animals data. Data is usually downloaded
through the FAOSTAT
package, using the MWTools::down_fao_live_animals
function, and after applying the MWTools::add_concordance_codes
function.
Usage
trim_fao_data(
.df,
yes_const = MWTools::amw_analysis_constants$yes_const,
country_incl_col = MWTools::conc_cols$country_incl_col,
country_name = MWTools::mw_constants$country_name
)
Arguments
- .df
The data frame containing live animals data, with added country codes. Usually produced by calling the
tidy_fao_live_animals
, andadd_concordance_codes
functions in sequence on the raw FAO data.- yes_const
- country_incl_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() %>%
trim_fao_data()