The function is concatenating text and images within paragraphs of a flextable object, this function is to be used with function compose().

as_paragraph(..., list_values = NULL)

Arguments

...

chunk elements that are defining paragraph

list_values

a list of chunk elements that are defining paragraph. If specified argument ... is unused.

Illustrations

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
#> a flextable object.
#> col_keys: `Ozone`, `Solar.R`, `Wind`, `Temp`, `Month`, `Day` 
#> header has 1 row(s) 
#> body has 10 row(s) 
#> original dataset sample: 
#>     Ozone Solar.R Wind Temp Month Day
#> 59     NA      98 11.5   80     6  28
#> 145    23      14  9.2   71     9  22
#> 106    65     157  9.7   80     8  14
#> 74     27     175 14.9   81     7  13
#> 16     14     334 11.5   64     5  16