Last chance! 50% off unlimited learning
Sale ends in
Functions to get or set the na string property of huxtable cells.
na_string(ht)
na_string(ht) <- value
set_na_string(ht, row, col, value, byrow = FALSE)
A huxtable.
A character string. This will be used to replace NA values in the display. Set to NA
to reset to the default, which is
""
.
A row specifier. See rowspecs
for details.
An optional column specifier.
If TRUE
, fill in values by row rather than by column.
For na_string
, the na_string
property.
For set_na_string
, the ht
object.
Other formatting functions: background_color
,
bold
, font_size
,
font
, number_format
,
text_color
# NOT RUN {
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)
# }
Run the code above in your browser using DataLab