Before you start
- No prior coding needed. Just a computer and a web browser.
- Any term new? The Glossary has it.
Learning objectives
By the end of this lesson you will be able to: install R from CRAN; install the RStudio Desktop workspace; confirm both are working; and install your first packages.
Can't install right now? You can still start
Installing is the step that stops most beginners, so it is optional at first. R Level 1 (Basics) runs real R inside your browser: no install, nothing to break. Come back here when you are ready to work with your own files, which is what professionals do.
Two pieces, and why
You install two things. R is the actual language and engine. RStudio is the workspace you'll spend your time in - it gives you a code editor, your plots, your data, and your console all in one window. R is the car; RStudio is the comfortable dashboard. Install R first, then RStudio.
Why R for bioinformatics?
R was built by statisticians, and the gold-standard tools for RNA-seq, differential expression, and genomics - DESeq2, edgeR, limma, and the whole Bioconductor project - live in R. R is the standard home for expression analysis, so learning it opens all of those tools to you.
Step 1 - Install R (from CRAN)
R is distributed by CRAN (the Comprehensive R Archive Network) at cran.r-project.org. Pick your OS:
πͺ Windows Windows
- Go to
cran.r-project.orgβ "Download R for Windows" β "base" β "Download R for Windows". - Run the
.exeinstaller and accept the defaults.
π macOS Intel & Apple Silicon
- Go to
cran.r-project.orgβ "Download R for macOS". - Pick the right
.pkg: arm64 for any Apple Silicon (M-series) Mac running macOS 14 or newer, or the x86_64 build for Intel Macs. - Open the
.pkgand follow the installer.
π§ Linux Ubuntu / Debian
The quickest route on Ubuntu/Debian:
sudo apt update sudo apt install r-base
For the very latest R, CRAN has per-distro instructions at cran.r-project.org/bin/linux. On Fedora, use sudo dnf install R.
Step 2 - Install RStudio Desktop (free)
Go to the RStudio Desktop download page and download the free RStudio Desktop for your OS. It will detect the R you just installed automatically.
Current RStudio versions need Windows 11 or macOS 14 or newer (64-bit Linux is fine). On an older computer, check the download page for an older release, or skip RStudio for now and use the in-browser R cells on this site.
- Windows: run the
.exeinstaller. - macOS: open the
.dmgand drag RStudio into Applications. - Linux: download the
.deb(Ubuntu/Debian) or.rpm(Fedora) and install it.
Step 3 - Check it worked
Open RStudio. In the Console pane (bottom-left), type this and press Enter:
R.version.string # [1] "R version 4.x.x ..." 1 + 1 # [1] 2
If R answers, you're in business. π
Step 4 - Install your first packages
Packages add features. We'll grab the tidyverse (the modern toolkit for data work) and palmerpenguins (a friendly real dataset we'll use in the project). In the Console:
install.packages("tidyverse") install.packages("palmerpenguins")
This downloads from CRAN and can take a few minutes the first time - that's normal. If R asks to use a personal library, say yes. If it asks whether to install from sources packages that need compilation, say no (compiling needs extra tools, such as Rtools on Windows).
Decode the jargon: Bioconductor
CRAN is R's general package store. Bioconductor is a second store dedicated to biology - it's where DESeq2 and friends live. You install from it a little differently: first install.packages("BiocManager") once, then BiocManager::install("DESeq2"). You don't need it yet, but now the name won't surprise you when it shows up in Track 3.
β You're ready whenβ¦
RStudio opens, 1 + 1 returns 2 in the Console, and library(tidyverse) runs without an error. It prints some red "Attaching packages" and "Conflicts ... masks" text: that is a normal message, not an error. On to the basics.
Stuck? Common snags
RStudio says it can't find R
This happens if RStudio was installed before R, or you have multiple R versions. On Windows, go to Tools β Global Options β General and choose the R version. On macOS or Linux (or if that does not help), reinstall R and then restart RStudio.
install.packages fails with a "non-zero exit status" on Linux
Some R packages need system libraries to compile. The error usually names what's missing (e.g. libcurl, libxml2). Install the matching -dev package with apt (e.g. sudo apt install libcurl4-openssl-dev) and try again.
Check your understanding
Sources & further reading
- CRAN. R for macOS (arm64 and Intel builds, system requirements). mac.r-project.org
- Posit. RStudio User Guide: Download RStudio. docs.posit.co
- Wickham H, Cetinkaya-Rundel M, Grolemund G. R for Data Science, 2nd ed. (2023), chapter 2 "Workflow: basics". r4ds.hadley.nz
- Huber W, Carey VJ, Gentleman R, et al. Orchestrating high-throughput genomic analysis with Bioconductor. Nat Methods 12: 115-121, 2015. doi:10.1038/nmeth.3252
Last reviewed: October 2026.
