Get the display names corresponding to given code names
Arguments
- code_name
A vector of code names to get the display names for
- language
The language ("disp_name_eng" or "disp_name_fin") of the resulting display names
- is_variable_name
If set to TRUE, then only variable names will be searched for display names. If FALSE (the default), only non-variable names will be searched.
- as_names
Should the display names be set as the names of the vector of code names? Default is FALSE.
Value
The display name(s) as a vector of character strings in the same order as the code names. If a display name is not found or language is undefined, the code name is returned. If as_names is TRUE, the display names are the names of the vector and code names are the values.
Details
is_variable_name is needed because there might be clashes between the variable and non-variable code names. E.g. organic_material is both an option in mgmt_operations_event and a variable. The language names ("disp_name_eng" and "disp_name_fin") correspond to the names of the columns in the display_names.csv file.