This functions allows to add a label to var. It's useful for the graphics or the reports. Obviously, this function can be applied only if a metadata exists
Arguments
- var
character - the name of the var(s) that we want to replace by the label, could be a vector
- metadata
data.frame - if we have a metadata loaded in your R, you can use to take the label of the vars.
- var_field
- character: name of the column in metadata that contains variable name (default: 'var')
- label_field
- character: name of the column in metadata that contains variable label (default: 'LABEL')
- include_varname
- logical. If returned string will also include variables names within brackets after label for variables that has label. (default: FALSE).