Learn R Programming

huxtable (version 5.7.0)

rotation: Rotate text within cells

Description

Numbers represent degrees to rotate text anti-clockwise:

Usage

rotation(ht)

rotation(ht) <- value

set_rotation(ht, row, col, value)

map_rotation(ht, row, col, fn)

Arguments

ht

A huxtable.

value

A numeric vector or matrix. 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.

Details

  • 0 is the default;

  • 90 is going upwards, for left-to-right languages;

  • 270 is going downwards.

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

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

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

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

Run the code above in your browser using DataLab