formatter: Formatter

Description Usage Arguments Value Examples

View source: R/functions.R

Description

Formatter

Usage

1
2
3
4
5
6
7
8
formatter(
  x,
  precision = 0,
  prefix = "",
  suffix = "",
  na.replace = 0,
  numeric.abbrev = FALSE
)

Arguments

x

value to be formatted

precision

precision of the numeric, must be

prefix

prefix

suffix

suffix

na.replace

na.replace

numeric.abbrev

numeric.abbrev

Value

string

Examples

1
2
3
4
5
6
7
8
9
formatter(NA, NA, NA, NA, "")
formatter(NA, 0, NA, NA)
formatter(123.123, 2, suffix = "%")
formatter(1231415161.2, precision = 0, suffix = " kg", numeric.abbrev = TRUE)
formatter(c(12.415, 132.141), -1, "$")
formatter(c(12.415, 132.141), 3, "$")
formatter(c("string", "string2"), na.replace = "")
formatter(213151, 2, suffix = NA)
formatter(c(NA, 2), 2, "", "%", na.replace = "")

andrew-a-hale/initmediaRUtils documentation built on Aug. 25, 2020, 2:51 p.m.