Convert Character Vectors From Variable To Constant Width
Utility function to convert a vector of character strings to one where each element has exactly ‘width’-bytes.
make.fixedwidth(x, width = NA, justify = c("left", "right"))
x |
A character vector. |
width |
Maximum width of each element. width=NA (default) will expand each element to the width required to contain the largest element of x without loss of information. |
justify |
How should the results be padded? ‘left’ will add spacing to the right of shorter elements in the vector (left-justified), ‘right’ will do the opposite. |
The current implementation of mmap only handles fixed-width
strings (nul-terminated). To simplify conversion of (potentially)
variable-width strings in a character vector, all
elements will be padded to the length of the longest string
in the vector or set to length width
if specified.
All new elements will be left or right justified based on the
justify
argument.
A character vector where each element is of fixed-width.
Future implementions will possibly support variable-width character vectors.
Jeffrey A. Ryan
month.name make.fixedwidth(month.name)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.