cl_levels {codelist} | R Documentation |
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)
Arguments
codelist |
the |
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.
Value
An integer vector with the same length as the number of rows in the code list.
Examples
data(objectcodes)
cl_levels(objectcodes)
[Package codelist version 0.1.0 Index]