R installation

Author

Søren O’Neill & Steen Harsted

Published

February 8, 2023

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

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 the file
  • Once the file is downloaded, install as per usual procedure

NOTE when a newer version of R is released and you install it onto your Windows computer, you should make certain that the older versions is deleted (unless you specifically want to keep both versions): Otherwise, you can run into unexpected problems.

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 and/or your distributions repositories may be restricted on the Region Syd network – use the wireless Gæstenet instead.

R is, in all probability, 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-citeproc) 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

1 Check that R was installed and is 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 on your SDU Windows computer, click the Start menu, scroll to R and open the r gui interface. Check the R installation version number.

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:

R

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.

Hvis din computer er udstedt af SDUs IT-afdelingen med Microsoft Windows som styresystem, kan du installere R via SDU’er Software Center.

R kan downloades fra internettet via dette link CRAN:

(Bemærk, at adgangen til CRAN hjemmesiden kan være begrænset på Region Syd netværket – brug det trådløse Gæstenet i stedet)

  • Nær toppen finder du linket Download R for Windows.
  • Klik på linket og download filen
  • Når filen er downloadet, skal du installere som den sædvanlige procedure

BEMÆRK når en nyere version af R udgives, og du installerer den på din Windows-computer, skal du sørge for, at de ældre versioner slettes (medmindre du specifikt ønsker at beholde begge versioner): Ellers kan du løbe ind i uventede problemer.

R kan downloades fra internettet via dette link CRAN:

(Bemærk, at adgangen til CRAN hjemmesiden kan være begrænset på Region Syd netværket – brug det trådløse Gæstenet i stedet)

  • Nær toppen finder du linket Download R for MacOS.
  • Klik på linket og download filen
  • Når filen er downloadet, skal du installere som den sædvanlige procedure

Bemærk, at adgangen til CRAN-hjemmesiden og/eller dine distributionslagre kan være begrænset på Region Syd-netværket – brug i stedet det trådløse Gæstenet.

R er efter al sandsynlighed allerede en del af dine foretrukne Linux-distributions softwarelagre. Hvis du bruger en Debian-baseret distribution, bør det være så simpelt som::

bruger@linux$ sudo apt install r-base

Hvis du vil generere litteraturreferencer (pandoc-citeproc) og/eller generere PDF-output (texlive), vil du sandsynligvis også have følgende software installeret:

user@linux$ sudo apt installer 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-livecommended -billeder texlive-pstricks texlive-xetex lmoderne texlive-lang-europæiske g++ libxml2-dev libcurl4-openssl-dev libssl-dev

Hvis du bruger en anden distribution (Arch, Red Hat osv.), skal du blot installere den samme software ved hjælp af deres pakkeadministratorer (yum, rpm osv.)

Du finder en videoguide til R-installation her

2 Kontrollér, at R blev installeret og fungerer

Hvis installationsprocessen blev fuldført som forventet, skulle du nu have et fungerende R-miljø på din computer – før vi går videre, er det en god idé at bekræfte det:

For at bekræfte, at R er installeret og fungerer, skal du klikke på Start-menuen, rulle ned til R og åbne r gui-grænsefladen. Tjek R-installations versionsnummeret.

For at bekræfte, at R er installeret og fungerer på din MacOS, skal du først åbne en Terminal:

Du kan finde Terminalen i Hjælpeprogrammer under Programmer, eller du kan holde Command-tasten nede, mens du trykker på mellemrum for at åbne Spotlight og indtaste “Terminal” - og dobbeltklik derefter på det relevante søgeresultat.

I MacOS Terminal skriv:

R

Åbn din foretrukne kommandolinje grænseflade og prøv dette:

bruger@linux: R

Outputtet skulle se sådan ud:

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 er gratis software og leveres med ABSOLUT INGEN GARANTI.
Du er velkommen til at videredistribuere den under visse betingelser.
Skriv 'license()' eller 'licence()' for distributionsdetaljer.

 Naturlig sprogunderstøttelse, men kører i en engelsk lokalitet

R er et samarbejdsprojekt med mange bidragydere.
Skriv 'contributors()' for mere information og
'citation()' om, hvordan man citerer R- eller R-pakker i publikationer.

Skriv 'demo()' for nogle demoer, 'help()' for onlinehjælp, eller
'help.start()' til en HTML-browsergrænseflade til hjælp.
Skriv 'q()' for at afslutte R.

Tryk på CTRL-d for at afslutte R-konsollen og vende tilbage til Linux-terminalen.