rotation {huxtable}R Documentation

Text rotation

Description

Functions to get or set the text rotation property of huxtable table cells.

Usage

rotation(ht)
rotation(ht) <- value
set_rotation(ht, row, col, value, byrow = FALSE)

Arguments

ht

A huxtable.

value

A numeric vector. Clockwise from the x axis, so 0 is left to right, 90 is going up, etc. Set to NA to reset to the default.

row

A row specifier. See rowspecs for details.

col

An optional column specifier.

byrow

If TRUE, fill in values by row rather than by column.

Details

You will probably need to set col_width and row_height explicitly to achieve a nice result, in both HTML and LaTeX.

Value

For rotation, the rotation attribute. For set_rotation, the ht object.

Examples


ht <- huxtable(a = 1:3, b = 1:3)
rotation(ht) <-  90
rotation(ht)


ht <- huxtable(a = 1:3, b = 3:1)
ht2 <- set_rotation(ht, 90)
rotation(ht2)
ht3 <- set_rotation(ht, 1:2, 1, 90)
rotation(ht3)
ht4 <- set_rotation(ht, 1:2, 1:2, c(90, 270), byrow = TRUE)
rotation(ht4)
ht5 <- set_rotation(ht, where(ht == 1), 90)
rotation(ht5)

[Package huxtable version 3.0.0 Index]