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?



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


Hi, check this out:


Modifying that function seemed to work for me.