labelizor | R Documentation |
The function replace text values in a flextable with labels. The labels are defined with character named vector.
The function is not written to be fast but to be handy. It does
not replace the values in the underlying dataset but replace the defined
content in the flextable (as defined with compose()
).
labelizor(x, j = NULL, labels, part = "all")
x |
a flextable object |
j |
columns selection |
labels |
a named vector whose names will be used to identify values to replace and values will be used as labels. |
part |
partname of the table (one of 'all', 'body', 'header', 'footer') |
mk_par()
, append_chunks()
, prepend_chunks()
z <- summarizor(
x = CO2[-c(1, 4)],
by = "Treatment",
overall_label = "Overall"
)
ft_1 <- as_flextable(z, separate_with = "variable")
ft_1 <- labelizor(
x = ft_1, j = c("stat"),
labels = c(Missing = "Kouign amann")
)
ft_1 <- labelizor(
x = ft_1, j = c("variable"),
labels = toupper
)
ft_1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.