Learn R Programming

flextable (version 0.9.11)

dim_pretty: Calculate optimal column widths and row heights

Description

return minimum estimated widths and heights for each table columns and rows in inches.

Usage

dim_pretty(x, part = "all", unit = "in", hspans = "none")

Arguments

x

a 'flextable' object, see flextable-package to learn how to create 'flextable' object.

part

part selector, see section Part selection with the part parameter in <Selectors in flextable>. Value 'all' can be used.

unit

unit for returned values, one of "in", "cm", "mm".

hspans

specifies how cells that are horizontally are included in the calculation. It must be one of the following values "none", "divided" or "included". If "none", widths of horizontally spanned cells is set to 0 (then do not affect the widths); if "divided", widths of horizontally spanned cells is divided by the number of spanned cells; if "included", all widths (included horizontally spanned cells) will be used in the calculation.

See Also

Other functions for flextable size management: autofit(), dim.flextable(), fit_to_width(), flextable_dim(), height(), hrule(), ncol_keys(), nrow_part(), width()

Examples

Run this code
ftab <- flextable(head(mtcars))
dim_pretty(ftab)

Run the code above in your browser using DataLab