suffix: Formattable object with suffix

Description Usage Arguments Examples

View source: R/formats.R

Description

Formattable object with suffix

Usage

1
suffix(x, suffix = "", sep = "", ..., na.text = NULL)

Arguments

x

an object

suffix

a character vector put behind each non-missing value in x as being formatted.

sep

separator

...

additional parameter passed to formattable.

na.text

text for missing values in x.

Examples

1
2
3
4
suffix(1:10, "px")
suffix(1:10, ifelse(1:10 >= 2, "units", "unit"), sep = " ")
suffix(c(1:10, NA), "km/h", na.text = "(missing)")
suffix(percent(c(0.1, 0.25)), "*")

Example output

 [1] 1px  2px  3px  4px  5px  6px  7px  8px  9px  10px
 [1] 1 unit   2 units  3 units  4 units  5 units  6 units  7 units  8 units 
 [9] 9 units  10 units
 [1] 1km/h     2km/h     3km/h     4km/h     5km/h     6km/h     7km/h    
 [8] 8km/h     9km/h     10km/h    (missing)
[1] 10.00%* 25.00%*

formattable documentation built on Jan. 13, 2021, 7:17 a.m.