append chunks (for example chunk as_chunk())
in a flextable.
Arguments
- x
a 'flextable' object, see flextable-package to learn how to create 'flextable' object.
- ...
chunks to be appened, see
as_chunk(),gg_chunk()and other chunk elements for paragraph.- i
row selector, see section Row selection with the
iparameter in <Selectors in flextable>.- j
column selector, see section Column selection with the
jparameter in <Selectors in flextable>.- part
part selector, see section Part selection with the
partparameter in <Selectors in flextable>. Value 'all' is not allowed by the function.
See also
as_chunk(), as_sup(), as_sub(), colorize()
Other functions to compose cell content:
as_paragraph(),
compose(),
footnote(),
labelizor(),
prepend_chunks(),
void()
Examples
library(flextable)
img.file <- file.path(R.home("doc"), "html", "logo.jpg")
ft_1 <- flextable(head(cars))
ft_1 <- append_chunks(ft_1,
# where to append
i = c(1, 3, 5),
j = 1,
# what to append
as_chunk(" "),
as_image(src = img.file, width = .20, height = .15)
)
ft_1 <- set_table_properties(ft_1, layout = "autofit")
ft_1
#> Warning: Coercing 'list' RHS to 'character' to match the type of column 17 named 'txt'.
speed
dist
4 character(0)
2
4
10
7 character(0)
4
7
22
8 character(0)
16
9
10
