buildCPCHierarchy: Build CPC Hierarchy

Description Usage Arguments Value

View source: R/buildCPCHierarchy.R

Description

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

Usage

1
buildCPCHierarchy(data, cpcItemVar, levels = 3)

Arguments

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?

Value

Modifies the data object by adding cpcLvl columns (there will be "levels" columns added).


SWS-Methodology/faoswsSeed documentation built on Nov. 21, 2020, 5:43 p.m.