Numbers represent degrees to rotate text anti-clockwise:

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

Arguments

ht

A huxtable.

row

A row specifier. See rowspecs for details.

col

An optional column specifier.

fn

A mapping function. See mapping-functions for details.

value

A numeric vector or matrix.

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

Value

rotation() returns the rotation property. set_rotation() returns the modified huxtable.

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


rotation(jams) <-  90
rotation(jams)
#>     Type Price
#> 1     90    90
#> 1.1   90    90
#> 2     90    90
#> 3     90    90

jams2 <- set_rotation(jams,
      270)
rotation(jams2)
#>     Type Price
#> 1    270   270
#> 1.1  270   270
#> 2    270   270
#> 3    270   270

jams3 <- set_rotation(jams,
      2:3, 1, 270)
rotation(jams3)
#>     Type Price
#> 1     90    90
#> 1.1  270    90
#> 2    270    90
#> 3     90    90

jams4 <- map_rotation(jams,
      by_rows(
        270,
        90)
      )
rotation(jams4)
#>     Type Price
#> 1    270   270
#> 1.1   90    90
#> 2    270   270
#> 3     90    90