huxtable (version 1.2.0)

rotation: 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.

Value

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

Details

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

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataCamp Workspace