Formattable object with prefix
prefix(x, prefix = "", sep = "", ..., na.text = NULL)
an object
a character vector put in front of each non-missing
value in x
as being formatted.
separator
additional parameter passed to formattable()
.
text for missing values in x
.
prefix(1:10, "A")
#> [1] A1 A2 A3 A4 A5 A6 A7 A8 A9 A10
prefix(1:10, "Choice", sep = " ")
#> [1] Choice 1 Choice 2 Choice 3 Choice 4 Choice 5 Choice 6 Choice 7
#> [8] Choice 8 Choice 9 Choice 10
prefix(c(1:10, NA), prefix = "A", na.text = "(missing)")
#> [1] A1 A2 A3 A4 A5 A6 A7
#> [8] A8 A9 A10 (missing)
prefix(rnorm(10, 10), "*", format = "d")
#> [1] *9 *8 *10 *9 *10 *12 *10 *8 *10 *11
prefix(percent(c(0.1, 0.25)), ">")
#> [1] >10.00% >25.00%