strSplitAtChar {tlocoh} | R Documentation |
Split a character object at a specific character to wrap to multiple lines for plotting
strSplitAtChar(object, size, char = ".", separator = paste("\n", char, sep = ""), ...)
object |
Input character vector (should be length 1) |
size |
The maximum number of characters in one piece |
char |
The character to split the input string at |
separator |
The character to use as a separator in the returned object |
... |
Other arguments (unused) |
This will take a long character object and split it into pieces at character char
such that the length of each piece is <= size
.
If separator
is passed, the individual pieces will be concatenated using the separator
character and returned as a character vector of length 1.
Otherwise each piece will be returned as a separate element of a character vector.