Description Usage Arguments Note Examples
This function splits a character string across two lines, keeping lines as even as possible. Replaces the middlemost " " (determined by string length) with "\n"; and does not perform replacement if lines would have words with 3 or fewer characters.
1 |
text |
A vector of character strings. |
To use with ggplot2 add scale_x_discrete(labels = split_line)
to your ggobject.
1 2 | split_line(c('Hello World!', 'Goodbye Cruel World', 'To Myself'))
# Returns: 'Hello\nWorld!' 'Goodbye\nCruel World' 'To Myself'
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.