text: Return or set text

Description Usage Arguments Value Examples

View source: R/properties.R

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

1
2
3
4
5
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

 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")))

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

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

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