escape_contents

0th

Percentile

Escape cell contents

Functions to get or set the escape cell contents property of huxtable table cells.

Usage
escape_contents(ht)
escape_contents(ht) <- value
set_escape_contents(ht, row, col, value, byrow = FALSE)
Arguments
ht

A huxtable.

value

A logical vector or matrix. If TRUE, cell contents will be HTML or LaTeX escaped. Set to NA to reset to the default.

row

A row specifier. See rowspecs for details.

col

An optional column specifier.

byrow

If TRUE, fill in values by row rather than by column.

Value

For escape_contents, the escape_contents attribute. For set_escape_contents, the ht object.

Aliases
  • escape_contents
  • escape_contents<-
  • set_escape_contents
  • escape_contents.huxtable
  • escape_contents<-.huxtable
Examples
# NOT RUN {
ht <- huxtable(Exponent = 2:4, Example = paste0('$x^', 2:4, '$'))
escape_contents(ht)[,2] <- FALSE

ht <- huxtable(a = 1:3, b = 3:1)
ht2 <- set_escape_contents(ht, TRUE)
escape_contents(ht2)
ht3 <- set_escape_contents(ht, 1:2, 1, TRUE)
escape_contents(ht3)
ht4 <- set_escape_contents(ht, 1:2, 1:2, c(TRUE, FALSE), byrow = TRUE)
escape_contents(ht4)
ht5 <- set_escape_contents(ht, where(ht == 1), TRUE)
escape_contents(ht5)
# }
Documentation reproduced from package huxtable, version 1.2.0, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.