huxtable (version 4.4.0)

rotation: Text rotation

Description

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

Usage

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

Arguments

ht

A huxtable.

value

A numeric vector. Anti-clockwise from the x axis, so 0 is left to right, 90 is going up, etc.

Set to NA to reset to the default, which is 0.

row

A row specifier. See rowspecs for details.

col

An optional column specifier.

fn

A mapping function. See mapping-functions for details.

byrow

Deprecated. Use by_cols() instead.

Value

For rotation, the rotation property. For set_rotation and map_rotation, the modified huxtable.

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 {
rotation(jams) <-  90
rotation(jams)


jams2 <- set_rotation(jams,
      90)
rotation(jams2)

jams3 <- set_rotation(jams,
      2:3, 1, 90)
rotation(jams3)

jams4 <- map_rotation(jams,
      by_rows(
        90,
        270)
      )
rotation(jams4)
# }

Run the code above in your browser using DataCamp Workspace