str_wrap {xfun} | R Documentation |
Wrap character vectors
Description
A wrapper function to make strwrap()
return a character vector of the same
length as the input vector; each element of the output vector is a string
formed by concatenating wrapped strings by \n
.
Usage
str_wrap(...)
Arguments
... |
Arguments passed to |
Value
A character vector.
Examples
x = sample(c(letters, " "), 200, TRUE, c(rep(0.5/26, 26), 0.5))
x = rep(paste(x, collapse = ""), 2)
strwrap(x, width = 30)
xfun::str_wrap(x, width = 30) # same length as x
[Package xfun version 0.50 Index]