Formattable object with suffix
suffix(x, suffix = "", sep = "", ..., na.text = NULL)
an object
a character vector put behind each non-missing
value in x
as being formatted.
separator
additional parameter passed to formattable()
.
text for missing values in x
.
suffix(1:10, "px")
#> [1] 1px 2px 3px 4px 5px 6px 7px 8px 9px 10px
suffix(1:10, ifelse(1:10 >= 2, "units", "unit"), sep = " ")
#> [1] 1 unit 2 units 3 units 4 units 5 units 6 units 7 units 8 units
#> [9] 9 units 10 units
suffix(c(1:10, NA), "km/h", na.text = "(missing)")
#> [1] 1km/h 2km/h 3km/h 4km/h 5km/h 6km/h 7km/h
#> [8] 8km/h 9km/h 10km/h (missing)
suffix(percent(c(0.1, 0.25)), "*")
#> [1] 10.00%* 25.00%*