padString: pad a character string to a fixed length

padStringR Documentation

pad a character string to a fixed length

Description

pad a character string to a fixed length

Usage

padString(
  x,
  stringLength = max(nchar(x)),
  padCharacter = " ",
  justify = "left",
  ...
)

Arguments

x

character vector

stringLength

integer length for the resulting character strings in x. By default, all strings are padded to the length of the longest entry, however stringLength can be defined to impose strict number of characters for all entries.

padCharacter

character string with nchar=1 used for padding.

justify

character string with "left", "right", "center" to indicate alignment of the resulting text string.

...

additional parameters are ignored.

Value

character vector of length(x)

See Also

Other jam string functions: asSize(), breaksByVector(), cPasteSU(), cPasteS(), cPasteUnique(), cPasteU(), cPaste(), fillBlanks(), formatInt(), gsubOrdered(), gsubs(), makeNames(), mixedOrder(), mixedSortDF(), mixedSorts(), mixedSort(), mmixedOrder(), nameVectorN(), nameVector(), padInteger(), pasteByRowOrdered(), pasteByRow(), sizeAsNum(), tcount(), ucfirst(), uniques()

Examples

padString(c("one","two","three"));
padString(c("one","two","three","four"), padCharacter="_", justify="center");


jmw86069/jamba documentation built on March 26, 2024, 5:26 a.m.