A function to access FAOSTAT data through the FAOSTAT API.
getFAO(
name = NULL,
domainCode = "RL",
elementCode = 5110,
itemCode = 6621,
query,
printURL = FALSE,
useCHMT = TRUE,
outputFormat = "wide",
returnNames = FALSE,
returnFlags = FALSE,
yearRange = NULL,
countrySet = NULL
)
Outputs a data frame containing the specified data.
The name to be given to the variable.
The domain of the data.
The code of the element.
The code of the specific item.
The object created if using the FAOsearch function.
Whether the url link for the data should be printed.
logical, whether the CHMT function should be applied to avoid double counting of China.
The format of the data, can be 'long' or 'wide'.
Logical, should the area, the element and the item names be reported?.
Logical, whether the flags should be returned. Only work with outputFormat long.
A numeric vector containing the years to be downloaded.
The FAOSTAT codes of those countries to be downloaded.
Need to account for multiple itemCode, currently only support one single variable.
getWDI
, getWDItoSYB
,
getFAOtoSYB
, FAOsearch