The function translate any country code scheme to another if both are in the
are among the types present in the FAO API. If you require other codes or
conversion of country names to codes, consider the countrycodes
package.
translate_countrycodes(
data,
from = c("FAO", "M49", "ISO2", "ISO3"),
to = c("M49", "FAO", "ISO2", "ISO3", "name"),
oldCode,
reset_cache = FALSE
)translateCountryCode(
data,
from = c("FAO", "M49", "ISO2", "ISO3"),
to = c("M49", "FAO", "ISO2", "ISO3", "name"),
oldCode,
reset_cache = FALSE
)
The data frame
The name of the old coding system
The name of the new coding system
The column name of the old country coding scheme
logical. Whether to pull data from FAOSTAT directly instead of caching