huxtable (version 4.4.0)

na_string: NA string

Description

Functions to get or set the na string property of huxtable cells.

Usage

na_string(ht)
na_string(ht) <- value
set_na_string(ht, row, col, value, byrow = FALSE)
map_na_string(ht, row, col, fn)

Arguments

ht

A huxtable.

value

A character string. This will be used to replace NA values in the display.

Set to NA to reset to the default, which is "".

row

A row specifier. See rowspecs for details.

col

An optional column specifier.

fn

A mapping function. See mapping-functions for details.

byrow

Deprecated. Use by_cols() instead.

Value

For na_string, the na_string property. For set_na_string and map_na_string, the modified huxtable.

See Also

Other formatting functions: background_color, bold, font_size, font, number_format, text_color

Examples

Run this code
# NOT RUN {
na_string(jams) <-  "--"
na_string(jams)
jams[2,2] <- NA 
jams

jams2 <- set_na_string(jams,
      "--")
na_string(jams2)

jams3 <- set_na_string(jams,
      2:3, 1, "--")
na_string(jams3)

jams4 <- map_na_string(jams,
      by_rows(
        "--",
        "")
      )
na_string(jams4)
# }

Run the code above in your browser using DataCamp Workspace