Getting Started with R

Author

Sven Otto

Published

April 16, 2024

Welcome

This tutorial aims to serve as an introduction to the software package R. Other excellent and much more exhaustive tutorials can be found at the following links:

Why R?

  • R is free of charge. On the R project webpage cran.r-project.org, you can download R for Windows, Mac OS, or Linux. Windows users can also directly follow this link: cran.r-project.org/bin/windows/base/
  • You can use R via a terminal or install an IDE, which is much more convenient. The celebrated IDE RStudio for R is also free of charge. Download RStudio here: posit.co/download/rstudio-desktop/. Make sure that you install R before installing RStudio.
  • Within RStudio, you can use Quarto, which provides an authoring framework to export your R code/outputs/plots together with LaTeX formulas and text as a PDF file or website in an appealing way. Have a look here. This website is also built with Quarto. You may want to use Quarto for your assignments, term papers, or thesis.
  • R is equipped with one of the most flexible and powerful graphics routines available anywhere. Check out these repositories with examples of appealing and informative R graphs: Clean Graphs, R Graph Catalog, Publication Ready Plots.
  • One of the best features of R are the large number of contributed packages from the statistical community. You find R packages for almost any statistical method out there and many statisticians provide R packages to accompany their research.
  • R is the de-facto standard for statistical science.

Matrix algebra

R is a matrix-based programming language. Matrix algebra provides an efficient framework for analyzing and implementing econometric methods. To refresh your matrix algebra skills and to learn how to use it in R, please check out my Crash Course on Matrix Algebra in R.

Accompanying R scripts

All R codes of the different sections can be found here:

Comments

Feedback is welcome. If you notice any typos or issues, please report them on GitHub or email me at sven.otto@uni-koeln.de.