trim_fao_data: Trim countries in FAO live animals data

View source: R/calc_amw_functions.R

trim_fao_dataR Documentation

Trim countries in FAO live animals data

Description

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()


EnergyEconomyDecoupling/MWTools documentation built on April 14, 2025, 9:27 a.m.