| as_clintable | R Documentation |
Convert a flextable into a clintable object
as_clintable(x, page_by = NULL, group_by = NULL)
x |
A flextable object |
page_by |
A variable in the input dataframe to use for pagination |
group_by |
A variable which will be used for grouping and attached as a label above the table headers |
There is no coerce_character argument here, unlike clintable().
A flextable arrives with its cell text already rendered, so the numeric
formatting this argument exists to avoid has already happened and coercing
the source data is no longer an option. The nearest equivalent is
flextable::set_formatter(x, values = as.character) before calling
as_clintable(), which rewrites every body cell from the stored data.
That is not the same operation: it replaces cell content, so any
chunk level work already done on the body - flextable::compose(),
flextable::colformat_*(), images, hyperlinks, equations - is discarded,
and columns keep the right alignment flextable gave them for being numeric.
Because that trade cannot be made safely on the user's behalf, it is left
to the caller. To get the coercion without the trade, build with
clintable(x, coerce_character = TRUE) instead.
A clintable object
ft <- flextable::flextable(mtcars)
as_clintable(ft)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.