index: Return or set index

Description Usage Arguments Value Examples

View source: R/properties.R

Description

These property functions modify or return the index of a hf_line object. The index sets the order in which a title will appear. Indicies can be any numeric value as long as they are not duplicated.

Usage

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

index(x) <- value

set_index(x, value)

Arguments

x

A hf_line object

...

Additonal arguments passed to method dispatch

value

Numeric value to order index

Value

For index(), the index attribute of the supplied hf_line object. For `index<-()` and set_index(), the modified object.

Examples

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

index(rtf$titles[[1]])
# Returns NULL

index(rtf$titles[[1]]) <- 2
# Sets index of first titles to 2

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