text {pharmaRTF}R Documentation

Return or set text

Description

These property functions modify or return the fonts of a rtf_doc object. text() will always return a vector of length 2. If the text is only of length one an empty string will be appended.

Usage

text(x, ...)

text(x) <- value

set_text(x, value)

Arguments

x

A hf_line object

...

Additonal arguments passed to method dispatch

value

A character vector of length 0, 1, or 2 to set the text value of a hf_line object.

Value

For text(), the text vector of the supplied hf_line object. For `text<-()` and set_text(), the modfied object.

Examples

library(huxtable)
ht <- huxtable(
  column1 = 1:5,
  column2 = letters[1:5]
)
rtf <- rtf_doc(ht, list(hf_line("aTitle")))

text(rtf$titles[[1]])
# Returns "aTitle" ""

text(rtf$titles[[1]]) <- "aDifferentTitle"
# Sets titles to "aDifferentTitle"


[Package pharmaRTF version 0.1.4 Index]