Formattable object with prefix

prefix(x, prefix = "", sep = "", ..., na.text = NULL)

Arguments

x

an object

prefix

a character vector put in front of 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

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] *10 *10 *8  *10 *9  *10 *9  *10 *10 *9 
prefix(percent(c(0.1, 0.25)), ">")
#> [1] >10.00% >25.00%