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

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:
主站蜘蛛池模板: 敦煌市| 泽州县| 留坝县| 饶阳县| 将乐县| 通许县| 南投县| 沂源县| 郯城县| 资中县| 宜黄县| 根河市| 嘉义市| 江北区| 汉川市| 泰州市| 微博| 平乡县| 余干县| 新晃| 内乡县| 奎屯市| 遂平县| 滦平县| 织金县| 方正县| 巫山县| 莫力| 陵川县| 太仓市| 永昌县| 桐庐县| 宝清县| 临城县| 马鞍山市| 托里县| 环江| 司法| 西贡区| 肥东县| 巩义市|