The function formats means and
standard deviations as mean (sd)
.
See also
Other text formatter functions:
fmt_2stats()
,
fmt_dbl()
,
fmt_header_n()
,
fmt_int()
,
fmt_n_percent()
,
fmt_pct()
,
fmt_signif_after_zeros()
Examples
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
avg
3.0 (1.0)
6.0 (2.0)
9.0 (3.0)