Description Usage Arguments Value See Also Examples
Wrap strings across lines
1 2 | wrap_lines(x, n, sep = "\n", max_lines = Inf, dots = "...",
hard = FALSE, tol = if (hard) 0L else 3L)
|
x |
Strings to be wrapped |
n |
Number of characters per line after wrapping |
sep |
Separator used for combining lines |
max_lines |
Wrap every string to at most ‘max_lines’ lines |
dots |
String to be inserted to indicate that a string was truncated |
hard |
TRUE if lines should have a fixed length of ‘n’ even if that means line breaks in the middle of a word |
tol |
Lines will be allowed to be ‘tol’ characters longer than ‘n’ if that makes the line lengths more even overall |
A list of strings each of which spans at most ‘max_lines’ physical lines of length 1 to ‘n + tol’.
1 2 3 | s <- "The quick yellow-orange-red-brown fox jumps over a 3-year-old, lazy dog."
pr(wrap_lines(s, 12))
pr(wrap_lines(s, 12, hard = TRUE))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.