| na_string {huxtable} | R Documentation |
Functions to get or set the na string property of huxtable table cells.
na_string(ht) na_string(ht) <- value set_na_string(ht, row, col, value, byrow = FALSE)
ht |
A huxtable. |
value |
A character string. This will be used to replace NA values in the display. Set to |
row |
A row specifier. See |
col |
An optional column specifier. |
byrow |
If |
For na_string, the na_string attribute.
For set_na_string, the ht object.
Other formatting functions: background_color,
bold, font_size,
font, number_format,
text_color
ht <- huxtable(a = 1:3, b = 1:3)
na_string(ht) <- '--'
na_string(ht)
ht[2,2] <- NA
print_screen(ht)
ht <- huxtable(a = 1:3, b = 3:1)
ht2 <- set_na_string(ht, '--')
na_string(ht2)
ht3 <- set_na_string(ht, 1:2, 1, '--')
na_string(ht3)
ht4 <- set_na_string(ht, 1:2, 1:2, c('--', ''), byrow = TRUE)
na_string(ht4)
ht5 <- set_na_string(ht, where(ht == 1), '--')
na_string(ht5)