as_clintable: Convert a flextable into a clintable object

View source: R/clintable.R

as_clintableR Documentation

Convert a flextable into a clintable object

Description

Convert a flextable into a clintable object

Usage

as_clintable(x, page_by = NULL, group_by = NULL)

Arguments

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

Details

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.

Value

A clintable object

Examples


ft <- flextable::flextable(mtcars)
as_clintable(ft)


clinify documentation built on Aug. 2, 2026, 1:06 a.m.