Description Usage Arguments Value
This function takes a commodity tree and provides the level of each commodity within that tree.
1 2 | getCommodityLevel(commodityTree, parentColname, childColname,
returnMinLevel = TRUE)
|
commodityTree |
A data.table with parent and child node IDs (corresponding to the IDs in nodes) which specify the commodity tree structure. |
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. |
returnMinLevel |
Logical. If a node exists at multiple processing levels, should the minimum level be returned? If FALSE, the maximum is returned. |
A data.table with two columns: node (the ID of the commodity code) and level. A level of 0 indicates a top level node which is then processed into a level 1 node. Level 1 nodes are processed into level 2, and so on.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.