
Transform a 'compact_summary' object into a flextable
Source:R/compact_summary.R
as_flextable.compact_summary.Rdcompact_summary objects can be transformed into
a flextable with method as_flextable().
Numeric columns are formatted with formatC() using the
digits value stored in the object and the current
flextable defaults for big.mark and decimal.mark.
Usage
# S3 method for class 'compact_summary'
as_flextable(x, ...)Arguments
- x
A
compact_summaryobject produced bycompact_summary().- ...
unused arguments.
Value
A flextable() object.
See also
Other as_flextable methods:
as_flextable(),
as_flextable.data.frame(),
as_flextable.gam(),
as_flextable.glm(),
as_flextable.grouped_data(),
as_flextable.htest(),
as_flextable.kmeans(),
as_flextable.lm(),
as_flextable.merMod(),
as_flextable.pam(),
as_flextable.summarizor(),
as_flextable.table(),
as_flextable.tabular(),
as_flextable.tabulator(),
as_flextable.xtable(),
compact_summary()
Examples
z <- compact_summary(iris, show_type = TRUE, show_na = TRUE)
as_flextable(z)
Column
Type
N
NA
Values
Sepal.Length
numeric
150
0
Min: 4.3, Max: 7.9
Sepal.Width
numeric
150
0
Min: 2.0, Max: 4.4
Petal.Length
numeric
150
0
Min: 1.0, Max: 6.9
Petal.Width
numeric
150
0
Min: 0.1, Max: 2.5
Species
factor
3
0
'setosa', 'versicolor', 'virginica'