Installing R, RStudio and Bioconductor



About R, RStudio and Bioconductor

R is a software environment for statistical computing. R is completely free and is available for Windows, Mac and Linux.

RStudio is a graphical interface for R, with several windows and buttons, that can help you work more efficiently.

Bioconductor is an add-on for R, consisting of a series of packages (also called libraries) that provide tools for biological data analysis inside R.

Frequently asked questions about R on different platforms can be accessed through the following links:


Uninstalling R in Windows, Mac, Linux

As of March 2025 the version of R is 4.4.3 (version 4.5.0 was released in April, but depending on your Operating System it might not be available). If you already have a version of R installed that is not at least R 4.3 I strongly recommend that you remove it before installing a new version. I'll briefly describe how to remove R on different operating systems. These instructions might not suit your version of OS perfectly, so for more details you can visit the links mentioned above.

Windows

Go to the Control Panel and choose "Add/Remove Programs" (Windows XP) or "Programs and Features" (Windows Vista/7/10), locate R and remove it. An alternative is to look for the R folder that is part of the programs that appear in the Start Menu. Inside this folder there should be a link to Uninstall R.

Mac OS X

Open a Terminal (Applications / Utilities / Terminal) and in it type:

sudo rm -rf /Library/Frameworks/R.framework /Applications/R.app
you will need to provide your password.

Linux

Open a Terminal and type:

sudo apt --purge remove r-base r-base-dev
you will need to provide your password.


Installing R

Go to this website and choose one of the mirrors:

http://cran.r-project.org/mirrors.html

In the "Download and Install R" section, choose the link for Linux, MacOS X or Windows accordingly.

Windows

Click on base and download and install using the first link: Download R #.##.# for Windows

Mac OS X

In the Latest release: section, download and install the first file: R-#.##.#.pkg

Linux

Choose the distribution that you're using and follow the instructions... good luck! ;o)
Note: be sure to also install r-base-dev

Example in Ubuntu using apt (taken from https://cran.rstudio.com/bin/linux/ubuntu)


# update indices
sudo apt update -qq
# install two helper packages we need
sudo apt install --no-install-recommends software-properties-common dirmngr
# add the signing key (by Michael Rutter) for these repos
# To verify key, run gpg --show-keys /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc 
# Fingerprint: E298A3A825C0D65DFD57CBB651716619E084DAB9
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
# add the repo from CRAN -- lsb_release adjusts to 'noble' or 'jammy' or ... as needed
sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
# install R itself
sudo apt install --no-install-recommends r-base r-base-dev


Installing RStudio

Installing RStudio should be much easier. Simply download the appropriate installer for your operating system from:

Download RStudio Desktop

and follow the instructions.


Installing Bioconductor

It is very important that you are sure you already have the latest version of R installed on your computer. If you are not sure, do not try to install Bioconductor, since you will only have to start again later.

When you start R or RStudio (recommended), you should see something like this:

R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
...
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.
...

Is your R version at least 4.3?

Now, in order to install Bioconductor all you need to do is to paste the following commands inside an R session. In RStudio, this will be within the Console window.

install.packages("BiocManager")

BiocManager::install()

It may ask you if you want to update old packages. For now say [n]o.

You can now install and use any Bioconductor package starting with the same function:

BiocManager::install("Biobase")

library(Biobase)

and you should see:

Welcome to Bioconductor

    Vignettes contain introductory material; view with 'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Congratulations, you now have R, RStudio and Bioconductor installed and are almost ready to conquer Bioinformatics!


Installing additional packages from Bioconductor

At some point, you will need to install additional Bioconductor packages, depending on the kind of analysis you want to perform. In order to install them, you need to use the install function that comes in the BiocManager package you have already installed.

Linux in particular might require you to install other software before you can install some of these packages. It is quite likely that if you are using Linux, you will need to install the following to make sure everything works fine. In a regular Terminal, not inside R!

sudo apt install libxml2-dev libcurl4-openssl-dev libssl-dev curl

If you need to install several packages, you can adapt the following code, and paste it into your R session:

pkgs = c("Biobase", "Biostrings", "Rsamtools", "ShortRead", "rtracklayer", "edgeR", "statmod", "Rsubread", "tidyverse", "ggrepel")
BiocManager::install(pkgs)

The above list should include most of the packages needed for this workshop.

If you get a message like Do you want to install from sources the package which needs compilation? (Yes/no/cancel) it's probably best to answer no unless you know that you have installed/configured everything needed to compile packages in R.

On the other hand, if you get a message asking if you want to update other packages, this should be fine.

Finally, be patient, since downloading and installing many packages can take some time, depending on your internet connection.


Further information

The full instructions on how to install Bioconductor are also available here:

http://www.bioconductor.org/install/index.html