Skip to contents

produce a flextable describing a count table produced by function table().

This function uses the proc_freq() function.

Usage

# S3 method for table
as_flextable(x, ...)

Arguments

x

table object

...

arguments used by proc_freq().

Examples

tab <- with(warpbreaks, table(wool, tension))
ft <- as_flextable(tab)
ft

wool

tension

L

M

H

Total

A

Count

9 (16.7%)

9 (16.7%)

9 (16.7%)

27 (50.0%)

Mar. pct (1)

50.0% ; 33.3%

50.0% ; 33.3%

50.0% ; 33.3%

B

Count

9 (16.7%)

9 (16.7%)

9 (16.7%)

27 (50.0%)

Mar. pct

50.0% ; 33.3%

50.0% ; 33.3%

50.0% ; 33.3%

Total

Count

18 (33.3%)

18 (33.3%)

18 (33.3%)

54 (100.0%)

(1) Columns and rows percentages