Skip to contents

Returns the width, height and aspect ratio of a flextable in a named list. The aspect ratio is the ratio corresponding to height/width.

Names of the list are widths, heights and aspect_ratio.

Usage

flextable_dim(x, unit = "in")

Arguments

x

a flextable object

unit

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

See also

Other flextable dimensions: autofit(), dim.flextable(), dim_pretty(), fit_to_width(), height(), hrule(), ncol_keys(), nrow_part(), set_table_properties(), width()

Examples

ftab <- flextable(head(iris))
flextable_dim(ftab)
#> $widths
#> [1] 3.75
#> 
#> $heights
#> [1] 1.75
#> 
#> $aspect_ratio
#> [1] 0.4666667
#> 
ftab <- autofit(ftab)
flextable_dim(ftab)
#> $widths
#> [1] 5.774125
#> 
#> $heights
#> [1] 2.837469
#> 
#> $aspect_ratio
#> [1] 0.4914111
#>