How to preserve formatting from rstudio when copy/pasting to Word?

前端 未结 7 1895
生来不讨喜
生来不讨喜 2021-01-30 17:11

New to R, Rstudio, and SO -- my apologies in advance for any faux pas.

I want to reproduce my code in Word 2010 for a homework assignment. The scripts were written in r

7条回答
  •  一整个雨季
    2021-01-30 18:02

    If you just need the code as formatted:

    Step1: Just add #+eval=FALSE at the beginning of your code.

    Step2: Then go to File -> Knit Document. Compile the file in msword/PDF/Html.

    OR

    Just add #+eval=FALSE at the beginning of your code.

    Press CTRL+SHIFT+K and then compile the file in msword/PDF/Html.

    If you need the code with output do not enter add #+eval=FALSE at the beginning of your code and perform step 2 directly.

提交回复
热议问题