Documentation Index
Fetch the complete documentation index at: https://mintlify.com/davidgohel/flextable/llms.txt
Use this file to discover all available pages before exploring further.
as_flextable() is an S3 generic that converts various R objects into flextable objects. Each supported class has its own method with class-specific arguments.
Generic
The object to convert. See the methods below for supported classes.
Additional arguments passed to the specific method.
Return value
An object of classflextable.
Methods
as_flextable.data.frame()
Produces a compact summary of a data frame, showing the first rows and column types.
If the data frame has only one row, a simplified vertical layout is used.
Maximum number of rows to display.
If
TRUE, column names are split on non-alphanumeric characters.If
TRUE, character columns are truncated to short_size characters.Maximum character width for string columns when
short_strings = TRUE.Suffix appended to truncated string values.
If
TRUE, autofit() is applied before rendering.If
TRUE, column data types are shown below the column headers.Color used to render the column type labels.
as_flextable.table()
Converts a table object (produced by base::table()) into a flextable.
as_flextable.lm()
Produces a formatted coefficient table from a linear model fitted with lm(). Requires the broom package. Significance stars respect the options(show.signif.stars) setting.
as_flextable.glm()
Produces a formatted coefficient table from a generalized linear model fitted with glm(). Requires the broom package.
as_flextable.merMod()
Produces a formatted table from a mixed model. Supported classes: merMod, lme, gls, nlme, brmsfit, glmmTMB, glmmadmb. Requires the broom.mixed package.
If
TRUE, random effects are included in the table alongside fixed effects.as_flextable.htest()
Converts an htest object (from functions such as t.test(), chisq.test(), wilcox.test()) into a flextable.
as_flextable.kmeans()
Converts a kmeans object into a formatted cluster summary table. Requires the broom package.
Number of decimal places for numeric columns.
as_flextable.pam()
Converts a pam object (from the cluster package) into a formatted cluster summary table. Requires the broom package.
Number of decimal places for numeric columns.
as_flextable.tabular()
Converts a tabular object (from the tables package) into a flextable.
as_flextable.xtable()
Converts an xtable object (from the xtable package) into a flextable.
See also
flextable()— create a flextable directly from a data frameqflextable()— quick flextable constructor