Skip to content

Format Flextable

The format_flextable() function in the reportifyr package formats data frames or existing flextable objects according to a predefined flextable specification.


format_flextable()

R: Formats data frames to a flextable specification
format_flextableR Documentation

Description

Formats data frames to a flextable specification

Usage

format_flextable(data_in, table1_format = FALSE)

Arguments

data_in

The input data to be formatted. Must be either a data frame or a flextable object.

table1_format

A boolean indicating whether to apply table1-style formatting. Default is FALSE.

Value

A formatted flextable

Examples

## Not run: 
dt <- head(iris, 10)
format_flextable(
  data_in = dt
)

## End(Not run)

Returns

A formatted flextable object with styling applied based on the specified table1_format value.


Logging

  • Debug: Logs the start and end of the function, as well as validation of inputs.
  • Info: Logs the applied formatting mode (default or table1_format), and whether the input is converted to a flextable.

Additional Resources

  • reportifyr GitHub: Refer to the reportifyr repository for more details.
  • flextable Reference Manual: Refer to the flextable reference manual for specific inquiries related to flextable.