| as_paragraph | R Documentation |
as_paragraph() assembles one or more chunks into a single paragraph
that defines the content of a flextable cell. Each cell in a flextable
contains exactly one paragraph; a paragraph is an ordered sequence of
chunks.
Chunks are the smallest content units and can be created with
as_chunk() (formatted text), as_b() / as_i() (bold / italic
shortcuts), minibar() (inline bar), as_image() (image),
gg_chunk() (ggplot), as_equation() (equation) or
hyperlink_text() (link). Plain character strings passed to
as_paragraph() are automatically converted to chunks via
as_chunk().
The resulting paragraph is passed to the value argument of
compose(), mk_par(), add_header_lines(),
add_footer_lines() or footnote() to set cell content.
as_paragraph(..., list_values = NULL)
... |
chunk elements that are defining the paragraph content.
If a character is used, it is transformed to a chunk object with
function |
list_values |
a list of chunk elements that are defining
the paragraph content. If specified argument |
as_chunk(), minibar(),
as_image(), hyperlink_text()
Other functions to compose cell content:
append_chunks(),
compose(),
footnote(),
labelizor(),
prepend_chunks(),
void()
library(flextable)
ft <- flextable(airquality[sample.int(150, size = 10), ])
ft <- compose(ft,
j = "Wind",
value = as_paragraph(
as_chunk(Wind, props = fp_text_default(color = "orange")),
" ",
minibar(value = Wind, max = max(airquality$Wind), barcol = "orange", bg = "black", height = .15)
),
part = "body"
)
ft <- autofit(ft)
ft
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.