Description Usage Arguments Value
View source: R/buildCPCHierarchy.R
This function creates a CPC hierarchy by taking the substring of the CPC code, up to "levels" number of digits. For example, wheat (0111) would be in the group 011 if levels=3 and group 0 if levels=1. Note that
1 | buildCPCHierarchy(data, cpcItemVar, levels = 3)
|
data |
A data.table containing a column with CPC codes. |
cpcItemVar |
Character. The column name of data which corresponds to the item/CPC code (for example, "measuredItemCPC"). |
levels |
How many CPC levels should be constructed? |
Modifies the data object by adding cpcLvl columns (there will be "levels" columns added).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.