Description Usage Arguments Value
View source: R/elementNamesToCodes.R
This function converts element names (such as production, imports, ...) into codes (such as 5510, 5321, etc.). It only works with the codes defined in this file on the share drive: paste0(R_SWS_SHARE_PATH,"/browningj/elementCodes.csv") (which will eventually become an adhoc table). 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 | elementNamesToCodes(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 codes instead of names).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.