text_wrap | R Documentation |
Functions to break up character vector components to a specified width.
text_wrap(x, width)
word_wrap(
x,
width = getOption("width"),
tolerance = 8L,
hyphens = TRUE,
unlist = TRUE,
collapse = NULL
)
meta_word_cat(
...,
sep = "\n",
width = getOption("width"),
tolerance = 8L,
file = stdout(),
trail.nl = TRUE
)
meta_word_msg(
...,
sep = "\n",
width = getOption("width"),
tolerance = 8L,
trail.nl = TRUE
)
word_cat(
...,
sep = " ",
width = getOption("width"),
tolerance = 8L,
file = stdout()
)
word_msg(...)
word_comment(
x,
width = getOption("width"),
tolerance = 8L,
hyphens = TRUE,
unlist = TRUE,
color = crayon::has_color()
)
x |
character vector |
width |
what width to wrap at |
tolerance |
how much earlier than |
hyphens |
whether to allow hyphenation |
unlist |
logical(1L) if FALSE each element in |
text_wrap
breaks each element to a specified width
,
where width
can contain different values for each value in
x
word_wrap
wraps at whitespace, or crudely hyphenates if
necessary; note that unlike text_wrap
width
must be scalar
word_cat
is like word_wrap
, except it outputs to screen
word_msg
is like word_cat
, except it ouputs to stderr
meta_word_cat
is like word_cat
, except it wraps output
in formatting to highlight this is not normal output
Newlines are replaced by empty strings in the output so that each character vector in the output represents a line of screen output.
a list with, for each item in x
, a character vector
of the item wrapped to length width
if unlist
is a parameter, then a character vector, or
if not or if unlist
is FALSE, a list with each element from x
corresponding to an element from the list
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.