R: Escape cell contents

escape_contents {huxtable} | R Documentation

## Escape cell contents

### Description

Functions to get or set the escape cell contents property of huxtable 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, which is `TRUE`.
`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` property. For `set_escape_contents`, the `ht` object.

### Examples

    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)

[Package huxtable version 4.2.0 Index]