restack-across-down: Restack huxtables across/down the page

Description Usage Arguments Details Value See Also Examples

Description

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
restack_across(
  ht,
  rows,
  headers = TRUE,
  on_remainder = c("warn", "stop", "fill")
)

restack_down(
  ht,
  cols,
  headers = TRUE,
  on_remainder = c("warn", "stop", "fill")
)

Arguments

ht

A huxtable

rows, cols

How many rows/columns the new result should have.

headers

Logical. Take account of header rows/columns?

on_remainder

String. "warn", "stop" or "fill". See below.

Details

If headers is TRUE, header rows/columns will be repeated across/down the restacked huxtable as necessary.

on_remainder determines what happens if the huxtable could not be evenly divided for restacking:

Value

A new huxtable.

See Also

split-across-down

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
ht <- as_hux(matrix(LETTERS[1:4], 2, 2))
ht <- set_all_borders(ht)
ht

restack_down(ht, 1)
restack_across(ht, 1)

# headers:
restack_across(jams, 2)
restack_across(jams, 2,
      headers = FALSE)

# on_remainder:
restack_across(jams, 3,
      on_remainder = "fill")

huxtable documentation built on May 15, 2021, 1:09 a.m.