R: rotate cell text

rotate {flextable} | R Documentation

## rotate cell text

### Description

apply a rotation to cell text

### Usage

    rotate(x, i = NULL, j = NULL, rotation, align = "center", part = "body")

### Arguments

`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')

### Details

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.

### Examples

    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")

[Package flextable version 0.4.5 Index]