cl_levels: Get the hierarchical level for each code in a code list
Description
Get the hierarchical level for each code in a code list
Usage
cl_levels(codelist)
Value
An integer vector with the same length as the number of rows in the code
list.
Arguments
codelist
the codelist for which to determine the levels.
Details
Levels are numbered with 0 being the top-most level, which contains code
without parent (parent missing). In level 1 are codes that have a parent in
level 0. Etc.
When the code list does not have a 'parent' column, all codes are in level 0.