The function is concatenating text and images within paragraphs of
a flextable object, this function is to be used with functions such as compose()
,
add_header_lines()
, add_footer_lines()
.
This allows the concatenation of formatted pieces of text (chunks) that represent the content of a paragraph.
The cells of a flextable contain each a single paragraph. This paragraph is made of chunks that can be text, images or plots, equations and links.
Arguments
- ...
chunk elements that are defining paragraph. If a character is used, it is transformed to a chunk object with function
as_chunk()
.- list_values
a list of chunk elements that are defining paragraph. If specified argument
...
is unused.
See also
as_chunk()
, minibar()
,
as_image()
, hyperlink_text()
Other functions for mixed content paragraphs:
append_chunks()
,
compose()
,
prepend_chunks()
Examples
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
Ozone
Solar.R
Wind
Temp
Month
Day
98
11.5 
80
6
28
23
14
9.2 
71
9
22
65
157
9.7 
80
8
14
27
175
14.9 
81
7
13
14
334
11.5 
64
5
16
20
81
8.6 
82
7
26
108
223
8.0 
85
7
25
291
14.9 
91
7
14
23
220
10.3 
78
9
8
20
252
10.9 
80
9
7