index {pharmaRTF}R Documentation

Return or set index

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

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

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


[Package pharmaRTF version 0.1.4 Index]