R installation

How to install R on your computer.

Author
Published

January 10, 2024

1 Installation

If your computer was issued by the SDU IT department with MS Windows as the operating system, you can install R via SDUs Software Center.

In that case, you should install RTools along with R, if it is available. Ensure, that you download the version of RTools that correspond to you version of R (4.2 or 4.3, etc).

R can be downloaded from the internet via this link CRAN:

(Note, that access to the CRAN website may be restricted on the Region Syd network – use the wireless Gæstenet instead)

  • Near the top, you will find the link Download R for Windows.
  • Click the link and download hte file
  • Once the file is downloaded, install as per usual procedure

You should also install RTools along with R - make sure you use the version appropriate for you installation of R – Link to RTools.

R can be downloaded from the internet via this link CRAN:

(Note, that access to the CRAN website may be restricted on the Region Syd network – use the wireless Gæstenet instead)

  • Near the top, you will find the link Download R for MacOS.
  • Click the link and download hte file
  • Once the file is downloaded, install as per usual procedure

(Note, that access to the CRAN website may be restricted on the Region Syd network – use the wireless Gæstenet instead)

R is, in all probablity, already part of your preferred Linux distributions software repositories. If you use a Debian based distribution, it should be as simple as::

user@linux$ sudo apt install r-base

If you want to generate literature references (pandoc) and/or generate PDF output (texlive), you probably also want the following software installed:

user@linux$ sudo apt install pandoc pandoc-citeproc texlive-base texlive-extra-utils texlive-font-utils texlive-fonts-recommended texlive-fonts-extra texlive-latex-base texlive-latex-extra texlive-latex-recommended texlive-pictures texlive-pstricks texlive-xetex lmodern texlive-lang-european g++ libxml2-dev libcurl4-openssl-dev libssl-dev 

If you are using another distribution (Arch, Red Hat, etc) you simply need to install the same software using their package managers (yum, rpm, etc)

You will find a video guide to R installation here

2 Check that R is installed and working

If the installation process completed as expected, you should now have a working R environment on your computer – before we go any further, it is a good idea to confirm that:

To confirm that R is installed and working, click the Start menu, scroll to R and open the r gui interface. Check the R installation version number.

To confirm that R was installed and working on your MacOS, first open a Terminal:

You can find the Terminal in Utilities under Applications or your can hold down the Command key while pressing space to open Spotlight and enter “Terminal” – then double click the appropriate search result.

In the MacOS Terminal type:

...SKAF BILLEDE FRA EN MAC

Open your favorite command-line interface and try this:

user@linux: R

The output should look something like this:

R version 4.1.2 (2021-11-01) -- "Bird Hippie"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

Press CTRL-d to quit the R console and return to the Linux terminal.