Learn R Programming

flextable (version 0.9.2)

fmt_dbl: Format numerical data as percentages

Description

The function formats numeric vectors as percentages.

Usage

fmt_dbl(x)

Arguments

x

numeric values

See Also

tabulator(), mk_par()

Other text formatter functions: fmt_2stats(), fmt_avg_dev(), fmt_header_n(), fmt_int(), fmt_n_percent(), fmt_pct()

Examples

Run this code
library(flextable)

df <- data.frame(zz = .45)

ft_1 <- flextable(df)
ft_1 <- mk_par(
  x = ft_1, j = 1, part = "body",
  value = as_paragraph(as_chunk(zz, formatter = fmt_dbl)))
ft_1 <- autofit(ft_1)
ft_1

Run the code above in your browser using DataLab