Shorten strings to strings with a fix width of characters
fixWidthStr(str, nchar = 8, align = c("left", "right"))
A vector of strings
The fixed with
Character, how to align
Strings with more or fewer characters than nchar
are either shortened
or filled (with spaces)
A vector of strings with fixed widths
NA
will be converted to characters and the same fixed width
will be applied. The behavior is different from shortenStr
,
where NA
is kept as it is.