Here is a function I wrote to break a long string into lines not longer than a given length
strBreakInLines <- function(s, breakAt=90, prepend=\"\") {
w
For further completeness, there's:
stringi::stri_wrapstringr::str_wrap (which just ultimately calls stringi::stri_wrapThe stringi version will deal with character sets better (it's built on the ICU library) and it's in C/C++ so it'll ultimately be faster than base::strwrap. It's also vectorized over the str parameter.