format_value: Converts a (possibly compound) value into a string using the...

View source: R/format_value.R

format_valueR Documentation

Converts a (possibly compound) value into a string using the format information

Description

Converts a (possibly compound) value into a string using the format information

Usage

format_value(x, format = NULL, output = c("ascii", "html"), na_str = "NA")

Arguments

x

(ANY)
the value to be formatted.

format

(string or function)
the format label (string) or formatter function to apply to x.

output

(string)
output type.

na_str

(string)
string to display when the value of x is missing. Defaults to "NA".

Details

A length-zero value for na_str will be interpreted as "NA", as will any missing values within a non-length-zero na_str vector.

Value

Formatted text representing the cell x.

See Also

round_fmt()

Examples

x <- format_value(pi, format = "xx.xx")
x

format_value(x, output = "ascii")


formatters documentation built on June 22, 2024, 9:42 a.m.