Insert line breaks in long string — word wrap

前端 未结 4 1637
情书的邮戳
情书的邮戳 2020-12-03 01:15

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         


        
4条回答
  •  无人及你
    2020-12-03 02:00

    You can look at e.g. the write.dcf() FUNCTION in R itself; it also uses a loop so nothing to be ashamed of here.

    The first goal is to get it right --- see Chambers (2008).

提交回复
热议问题