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. If you want to work with expression data, R is unavoidable, and that's a good thing.
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 10/11
- 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 Apple Silicon (M1-M4), or the Intel build for older 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 posit.co/download/rstudio-desktop and download the free RStudio Desktop for your OS. It will detect the R you just installed automatically.
- 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. Say "yes" to any prompts.
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 (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. 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. In RStudio go to Tools β Global Options β General β and set the R version, or simply reinstall R 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.
