R for modellers - Vignette 01

Introduction to and installation of R

Julien Arino

Department of Mathematics

University of Manitoba*




* The University of Manitoba campuses are located on original lands of Anishinaabeg, Cree, Oji-Cree, Dakota and Dene peoples, and on the homeland of the Métis Nation.

Foreword: the R language

R was originally for stats but is now much more

  • Open source version of S
  • Appeared in 1993
  • Currently version 4.6.0
tail(rversions::r_versions(), n = 8)
    version                date               nickname semver
157   4.4.1 2024-06-14 07:08:17     Race for Your Life  4.4.1
158   4.4.2 2024-10-31 08:09:02         Pile of Leaves  4.4.2
159   4.4.3 2025-02-28 08:08:59            Trophy Case  4.4.3
160   4.5.0 2025-04-11 08:51:39 How About a Twenty-Six  4.5.0
161   4.5.1 2025-06-13 07:12:01      Great Square Root  4.5.1
162   4.5.2 2025-10-31 08:13:34 [Not] Part in a Rumble  4.5.2
163   4.5.3 2026-03-11 08:14:07    Reassured Reassurer  4.5.3
164   4.6.0 2026-04-24 07:17:39   Because it was There  4.6.0

R uses a lot of code from other languages

  • One major advantage in my view: uses a lot of C and Fortran code. E.g., deSolve:

The functions provide an interface to the FORTRAN functions ‘lsoda’, ‘lsodar’, ‘lsode’, ‘lsodes’ of the ‘ODEPACK’ collection, to the FORTRAN functions ‘dvode’, ‘zvode’ and ‘daspk’ and a C-implementation of solvers of the ‘Runge-Kutta’ family with fixed or variable time steps

Lots of people use R

  • Very active community on the web, easy to find solutions (same true of Python, I just prefer R)



  • This also means that ChatGPT or Google Gemini are quite good at answering questions about R

R is a scripted language

  • Interactive


  • Allows you to work in real time
    • Be careful: what is in memory might involve steps not written down in a script
    • If you want to reproduce your steps, it is good to write all the steps down in a script and to test from time to time using the command line; see Vignette 24

Similar to matlab and Python..


.. with some differences, of course! Otherwise, where would the fun be? ;)

Installing R

The main location - CRAN



  • To install, select your OS from the main page

A note for Linux users


  • Often, the version on your distribution is not the most up to date


  • Instructions are on CRAN about setting things up so you have the latest version. For instance,

Development environments

  • Terminal version, not very friendly
  • Nicer terminal: radian
  • Execute R scripts by using Rscript name_of_script.R. Useful to run code in cron, for instance
  • Integrate into jupyter notebooks and VS code
  • Use IDEs:
    • RStudio has become the reference; see Vignette 02
    • RKWard is useful if you are for instance using an ARM processor (Raspberry Pi, some Chromebooks..)