View source: R/labelling_for_plots.R
label_for_plot | R Documentation |
Function for converting variable values to labels suitable for reporting and graphs. It replaces all underscores with whitespaces and fixes whitespaces, removes numbering options at the start of the string, replaces the following abbreviations with the correct terms (CWT=community-wide, SBT=school-based, CDD=medicines distributors, Abd pain=abdominal), It also converts variable into factor for plotting, and 'other' options are always ordered last.
label_for_plot(dataset, ..., nchar = 20)
dataset |
A dataframe containing the variables to be relabelled |
... |
Variable(s) to be relabelled |
nchar |
Maximum number of characters in each line (default is 20) |
An object of the same type as dataset
with specified variable(s) as factor(s) with appropriate labelling.
dataset %>% label_for_plot(vil_mda_type)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.