Skip to contents

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, and add_concordance_codes functions in sequence on the raw FAO data.

yes_const

See MWTools::amw_analysis_constants.

country_incl_col

See MWTools::conc_cols.

country_name

See MWTools::mw_constants.

Examples

live_animals_data <- read.csv(file = MWTools::amw_test_data_path()) %>%
  tidy_fao_live_animals() %>%
  add_concordance_codes() %>%
  trim_fao_data()