Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

surround

Format strings for pretty output


Description

Format strings for pretty output

Usage

surround(x, pre = " ", post = " ", width = 8, ...)

Arguments

x

a vector

pre

text to prepend onto string

post

text to postpend onto string

width

desired width of string

...

additional arguments passed to format()

Value

a vector of strings padded to the desired width

Examples

surround(rbinom(10,20,.5), " ", " ", width=4)
surround(rnorm(10), " ", " ", width=8, digits = 2, nsmall = 2)

mosaic

Project MOSAIC Statistics and Mathematics Teaching Utilities

v1.8.3
GPL (>= 2)
Authors
Randall Pruim [aut, cre], Daniel T. Kaplan [aut], Nicholas J. Horton [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.