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

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:
主站蜘蛛池模板: 莱西市| 闻喜县| 酒泉市| 肥东县| 陇南市| 大足县| 凉山| 万盛区| 图木舒克市| 香格里拉县| 云浮市| 鄯善县| 瑞安市| 洞头县| 饶阳县| 迁安市| 航空| 海伦市| 保亭| 鄂州市| 兴安盟| 高雄县| 乌苏市| 惠东县| 武穴市| 泰州市| 南召县| 凤城市| 库伦旗| 张掖市| 綦江县| 呼玛县| 湟中县| 宾阳县| 新闻| 平塘县| 南安市| 台湾省| 嘉祥县| 大石桥市| 镇原县|