| rotate {flextable} | R Documentation |
apply a rotation to cell text
rotate(x, i = NULL, j = NULL, rotation, align = "center", part = "body")
x |
a flextable object |
i |
rows selection |
j |
columns selection |
rotation |
one of "lrtb", "tbrl", "btlr" |
align |
vertical alignment of paragraph within cell, one of "center" or "top" or "bottom". |
part |
partname of the table (one of 'all', 'body', 'header', 'footer') |
One common case is to rotate text to minimise column space. When rotating,
paragraph alignments will remain the same and often right aligned (
with an effect of top aligned when rotated). Use
align(..., align = "center") to center rotated text.
When function autofit is used, the rotation will be
ignored.
ft <- flextable(head(iris)) ft <- rotate(ft, rotation = "tbrl", part = "header", align = "center") ft <- align(ft, align = "center") ft <- autofit(ft) ft <- height(ft, height = max(dim_pretty(ft, part = "header")$widths), part = "header")