fmt_avg_dev | R Documentation |
The function formats means and
standard deviations as mean (sd)
.
fmt_avg_dev(avg, dev, digit1 = 1, digit2 = 1)
avg , dev |
mean and sd values |
digit1 , digit2 |
number of digits to show when printing 'mean' and 'sd'. |
tabulator()
, mk_par()
Other text formatter functions:
fmt_2stats()
,
fmt_dbl()
,
fmt_header_n()
,
fmt_int()
,
fmt_n_percent()
,
fmt_pct()
,
fmt_signif_after_zeros()
library(flextable)
df <- data.frame(avg = 1:3 * 3, sd = 1:3)
ft_1 <- flextable(df, col_keys = "avg")
ft_1 <- mk_par(
x = ft_1, j = 1, part = "body",
value = as_paragraph(fmt_avg_dev(avg = avg, dev = sd))
)
ft_1 <- autofit(ft_1)
ft_1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.