1 Installations

1.1 R

Install R version 3.5.0 or higher

  • Go to https://cran.rstudio.com
  • Click on the link corresponding to your operating system
  • Download the recommended files for your system
  • Run the installer or move the downloaded files to suitable place on your computer

1.2 RStudio

RStudio window view following launching

Figure 1.1: RStudio window view following launching

1.3 Markdown

1.4 R Markdown

  • R Markdown (.Rmd) allows to combine typing text in Markdown and execute code in R. It is thus great to document data analysis.
  • A short introduction to R Markdown is under https://rmarkdown.rstudio.com/articles_intro.html
  • To open R Markdown in RStudio click File -> New File -> R Markdown
Opening new R Markdown file within RStudio

Figure 1.2: Opening new R Markdown file within RStudio

  • This opens an Untitled.Rmd document with example usage of text writing using Markdown and embedded R code in so called code chunks. To render .Rmd into .HTML press Knitr button. This should generate .HTML file.
    Rendering .Rmd with Knitr

    Figure 1.3: Rendering .Rmd with Knitr