Format strings for pretty output
surround(x, pre = " ", post = " ", width = 8, ...)a vector
text to prepend onto string
text to postpend onto string
desired width of string
additional arguments passed to format()
a vector of strings padded to the desired width
surround(rbinom(10,20,.5), " ", " ", width=4)
#> [1] " 5 " " 14 " " 10 " " 7 " " 9 " " 11 " " 8 " " 9 " " 13 " " 12 "
surround(rnorm(10), " ", " ", width=8, digits = 2, nsmall = 2)
#> [1] " -0.316 " " -0.448 " " -0.011 " " 0.011 " " 1.419 " " 1.189 "
#> [7] " 0.600 " " -0.853 " " -0.789 " " -0.824 "