Description Usage Arguments Value
This function generates plots for each of the commodity trees defined in a commodity tree object. A separate plot is given for each node that has no parent, and this should allow for the producing of a wheat tree, a milk tree, etc.
1 2 3 | plotCommodityTrees(commodityTree, parentColname, childColname,
extractionColname, dir = getwd(), prefix = "commodity_tree",
adjExtractionRates = TRUE)
|
commodityTree |
A data.table with parent and child node IDs (corresponding to the IDs in nodes) which specify the commodity tree structure. Additionally, there should be a column with extraction rate data and a column with shares data. |
parentColname |
The column name of commodityTree which contains the ID of the parent node. |
childColname |
The column name of commodityTree which contains the ID of the child node. |
extractionColname |
The column name of commodityTree which contains the extraction rate data. |
dir |
The directory where the commodity trees should be saved. |
prefix |
The prefix to add to the name of the plot(s) which will be saved to dir. One plot is created for each commodity tree. |
adjExtractionRates |
Logical. Typically, the extraction rates are stored as percentages multiplied by 10000, i.e. 5 0.05*10000 = 500. If TRUE, the function converts them to percentages. |
No object is returned, but image files of the plots are written out to .png files. The input parameter dir specifies where these files will be placed.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.