R knit to PDF - how to wrap long lines

Hi everyone:

When knitting RStudio file to PDF, the longer lines of code and text keep getting cut off on the output. Is there any way we can wrap these lines automatically for the output please?

Thanks!

1 Like

Hi LearnLearn - I had a look on the net, and wondered if this post was of any use to you?

1 Like

Hi, check this out:

https://github.com/yihui/knitr-examples/blob/master/077-wrap-output.Rmd

Modifying that function seemed to work for me.

3 Likes