Description Usage Arguments Value
View source: R/elementCodesToNames.R
This function converts element codes (such as 5510, 5421, ...) into meaningful names (such as "production", "yield", etc.). It only works with the codes defined in a file called elementCodes, which was om the Share drive paste0(R_SWS_SHARE_PATH,"/browningj/") but now is an ad hoc dataTable in the SWS in the AgricultureProduction domain. The tricky part of this function is that the commodity type must be used to correctly choose the element code, as different commodities may use different codes for production, yield, ...
1 2 | elementCodesToNames(data, elementCol = NULL, itemCol = NULL,
standParams = NULL)
|
data |
The data.table containing the codes to be mapped. It is assumed to have one column with element codes and one column with item codes. |
elementCol |
The column name of the column with element codes. |
itemCol |
The column name of the column with item codes. |
standParams |
A list of parameters (see faoswsStandardization::defaultStandardizationParameters). If supplied, elementCol and itemCol can be NULL. |
The passed data.table "data" but with an updated element column (with names instead of codes).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.