View source: R/layout_helpers.r
| add_units | R Documentation |
add_units adds units to variable labels from a named vector matching the names of the labels.
add_units(x, y)
x |
contains variable labels. |
y |
contains units to be added, matched by name. |
Named vector with labels and added units, if available (otherwise "NA" is added).
Other table layout:
add_colgroup(),
add_cols(),
add_rowgroup(),
firstrow_css(),
layout_html(),
order_by_vector(),
order_layout(),
prepare(),
print_abbrev(),
query_abbrev()
variable_labels <- c( 'apples' = "Apples", 'bnanas' = "Bananas", 'peas' = "Peas" ) unit_labels <- c( 'apples' = "pcs", 'peas' = "kg" ) add_units(variable_labels, unit_labels)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.