Name-value pairs of functions, names should be existing col_key values
values
format functions, If values is supplied argument ... is ignored.
It can be a list of name-value pairs of functions, names
should be existing col_key values.
If values is a single function, it will be applied to each column.
part
part of the table (one of 'body' or 'header' or 'footer')
where to apply the formatter functions.
fmt_double, fmt_integer
arguments used by sprintf to
format double and integer columns.
fmt_date, fmt_datetime
arguments used by format to
format date and date time columns.
false, true
string to be used for logical columns
na_str
string for NA values
set_formatter_type
set_formatter_type is an helper function to quickly define
formatter functions regarding to column types.
This function will be deprecated in favor of the colformat_* functions,
for example colformat_double(). Note that we want to deprecate the
set_formatter_type() function, not the set_formatter() function.
ft <- flextable(head(iris))
ft <- set_formatter(
x = ft,
Sepal.Length = function(x) sprintf("%.02f", x),
Sepal.Width = function(x) sprintf("%.04f", x)
)
ft <- theme_vanilla(ft)
ft