header_rows: Return or set the header_rows

Description Usage Arguments Value Examples

View source: R/properties.R

Description

These property functions modify or return the header_rows attribute of a rtf_doc object. Only required and valid when the rtf_doc table object is a huxtable.

The header rows control the number of rows taken from a huxtable table into the header of the document as the column header. When pulled into the headers, these rows are repeated on each page. Can be set to 0 to disable repeating column headers.

Usage

1
2
3
4
5
header_rows(x, ...)

header_rows(x) <- value

set_header_rows(x, value)

Arguments

x

A rtf_doc object

...

Additonal arguments passed to method dispatch

value

A numeric value to change the header_rows attribute.

Value

For header_rows(), the header_rows attribute of the rtf_doc object. For `header_rows<-`() and set_header_rows(), the modified object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
ht <- huxtable::huxtable(
  column1 = 1:5,
  column2 = letters[1:5]
)
rtf <- rtf_doc(ht, list(hf_line("aTitle")))

header_rows(rtf)
# This is a wrapper for header_rows(x$table)
header_rows(rtf$table)
# Both of these return 1, the default

header_rows(rtf$table) <- 0
# Sets header_rows to 0

pharmaRTF documentation built on Sept. 28, 2021, 5:08 p.m.