R: Caption

caption {huxtable} | R Documentation

## Caption

### Description

Functions to get or set the table-level caption property of a huxtable.

### Usage

    caption(ht)
    caption(ht) <- value
    set_caption(ht, value)

### Arguments

`ht` | A huxtable.
`value` | A length-one character vector. Set to `NA` to reset to the default, which is `NA`.

### Details

Captions are not escaped. See the example for a workaround.

### Value

For `caption`, the `caption` property. For `set_caption`, the `ht` object.

### See Also

`caption_pos()`

### Examples

    ht <- huxtable(a = 1:3, b = 1:3)
    caption(ht) <-  'An example table'
    caption(ht)
    print_screen(ht)
    ht <- hux(a = 1:2, b = 1:2)
    caption(ht) <- sanitize('Make $$$ with us', type = 'latex') # escape caption characters

[Package huxtable version 4.2.0 Index]