官术网_书友最值得收藏!

Getting started with R Markdown in RStudio

Let's recapitulate, that R Markdown uses various technologies and is seamlessly embedded in RStudio.

Creating your first R Markdown document

To create an R Markdown document, perform the following steps:

  1. First, click on the new file icon in RStudio and select R Markdown....
  2. This will open a new popup window where you can adjust a variety of settings.
  3. For our first document, we will leave all these settings as they are. You may change the Title and the Author name.
  4. After hitting the OK button, RStudio will automatically open a new prefilled .Rmd file.
  5. For a first test run, just click on the Knit HTML button with the small ball of yarn icon before the corresponding text.

    As you can see, the knitted file opens by default in a preview window.

  6. Instead of using the default option, it is recommended that you change the settings so that RStudio opens the output of a knitted .Rmd file in a dedicated viewer pane. Click on the small down-pointing arrow, to the right of the Knit HTML button, and check View in Pane to enable the pane view.
  7. With this setting, it is now possible to write and generate R Markdown documents side-by-side, and that too, in a very comfortable manner:
主站蜘蛛池模板: 万宁市| 冷水江市| 天峨县| 固始县| 五峰| 新蔡县| 阿图什市| 栖霞市| 温泉县| 五原县| 九龙城区| 广宗县| 宁都县| 宣威市| 桐庐县| 乌拉特后旗| 深州市| 剑阁县| 沂水县| 怀安县| 蕉岭县| 区。| 思南县| 闽清县| 潞城市| 巩留县| 老河口市| 富蕴县| 沐川县| 祁门县| 朝阳县| 南京市| 阳泉市| 合作市| 重庆市| 西充县| 吉水县| 石家庄市| 嘉义市| 武城县| 本溪|