Skip to content

Remove functions linked to defunct uses of FAOSTAT

Certain functions like FAOtoSYB are designed specifically for the Statistical Yearbook.

These functions are either no longer used for that purpose and even if they were, these functions shouldn't be in a FAOSTAT package, they should be in a package for that purpose which Depends on FAOSTAT. In order for a function to remain, it should be FAOSTAT specific or sufficiently useful for FAOSTAT data.

Functions to remove:

  • Aggregation: Method to aggregate groups via relationship df. Too generic
  • chConstruct: fancy wrapper which is basically group by diff - unnecessary
  • chgr: backend for chConstruct
  • constructSYB: Statistical Yearbook-specific
  • ebind: Only there to make ggplot2 graphs that aren't even in the package
  • geogr: Calculates geometric growth rate, not FAOSTAT-specific
  • getFAOtoSYB: Statistical Yearbook-specific
  • getWDI: There's already a wdi package, non FAOSTAT-specific
  • getWDImetaData: There's already a wdi package, non FAOSTAT-specific
  • getWDItoSYB: There's already a wdi package, non FAOSTAT-specific
  • grConstruct: Calculates geometric growth rate, not FAOSTAT-specific
  • indConstruct: Calculates relative size of a value relative to a reference year by country. Not FAOSTAT-specific
  • lsgr: Calculates least squares growth rate. Not FAOSTAT-specific
  • mergeSYB: Wrapper for translateCountryCode. Not useful
  • printLab: Wrapper for cat to make error messages. Not really helpful
  • shConstruct: Calculates share of variable, not FAOSTAT-specific

Unsure:

  • translateUnit: This is note very usefull as it stands, but could be used to detect units and turn them into multipliers for something similar to what scaleUnit is meant to do. Worth thinking about
  • scaleUnit: Multiply multiple columns by a scalar. Not FAOSTAT-specific, but useful for converting units to a common format

Dependencies to remove:

  • ggplot2

Functions to keep:

  • CHMT: China deduplication. Keep and make compatible with M49
  • FAOcheck: Checks for countries that have the same territory such as USSR and its satellites from being present in the data at the same time. Needs a name change
  • FAOcountryProfile: Table of country code conversions and names. Needs an update for Eswatini. It would be good if we could remove this by calling the API
  • FAOmetaTable: Table of codes and names. We'll keep it for now, but I suspect we can replace it with data from the API
  • FAOregionProfile: Country profile but for regions
  • FAOSearch: API call needs to be replaced. This should be a series of functions to get datasets, domains, elements, etc.
  • faostat_bulk_download: Part of the API
  • fillCountryCode: matches country names to codes. Similar to functionality of the countrycode package
  • get_fao: alias for read_fao
  • overlap: Core function of FAOcheck, should be moved into its Rd file
  • read_fao: Core function, needs to stay
  • translateCountryCode: Does what countrycode does, but at least with this, we can get official FAO approval
Edited by Sebastian