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

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
#> 124    96     167  6.9   91     9   1
#> 31     37     279  7.4   76     5  31
#> 59     NA      98 11.5   80     6  28
#> 145    23      14  9.2   71     9  22
#> 106    65     157  9.7   80     8  14