This article will explain how to install R, Rstudio, and packages in R.If you are already familar with this material, skip to the Install packages for workshop section to see the packages that we will use in the workshop.
Download R from CRAN. Go to the cran homepage https://cran.r-project.org/. Select your operating system.
Select the newest R version, download the .pkg
file, then open and install.
Select the base
link, then click download to download the .exe
file. Open this file to install R.
If you are on linux, then follow the documentation for your linux OS.
You may need to install the xcode command line tools if a package requires compilation. Open the Terminal from /Applications/Utilities/
(or use the search tool to search for terminal)
Type the following into Terminal:
xcode-select --install
Press “Install” and verify installation by typing into terminal:
gcc --version
Which should print something similar to this:
#' gcc (GCC) 4.8.5
#' Copyright (C) 2015 Free Software Foundation, Inc.
#' This is free software; see the source for copying conditions. There is NO
#' warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Here’s a youtube video explainer
Next you need to install gfortran
. Follow this link and go to the “INSTALL OS-SPECIFIC GFORTRAN BINARY” section. Select the download link based on your macOS version. This will supply an installer.
You need to install Rtools
from CRAN. Go to this link and download the exe installer for your OS: https://cran.r-project.org/bin/windows/Rtools/
You probably have a compiler already?
Go to the Rstudio website and download the installer for your OS.
Once you have R and Rstudio set up, open up rstudio, then we will install various packages.
In general there are 3 common places that you can get R packages from:
install.packages()
function. A successful install only needs to be done once.In your console execute the following:
install.packages("tidyverse")
install.packages("Seurat")
Test package installation once complete by loading the package(s)
library(tidyverse)
library(Seurat)
To install bioconductor packages you should use the CRAN package BiocManager
. BiocManager has a function called install()
to install bioconductor packages. For example to install clustifyr
install.packages("BiocManager")
library(BiocManager)
install("clustifyr")
# or equivalently you could run BiocManager::install("clustifyr")
remotes
package. Presto
or djvdj
are examples of single cell RNA-seq analysis packages on github. You’ll need to find the organization name and the repository name on github to install.install.packages("remotes")
::install_github('rnabioco/djvdj')
remotes::install_github('immunogenomics/presto') remotes
We will use the following packages:
From CRAN:
- tidyverse
- Seurat
- rmarkdown
- cowplot
- pheatmap
- markdown
install.packages(c('tidyverse',
'rmarkdown',
'Seurat',
'cowplot',
'pheatmap',
'markdown'))
From Bioconductor:
- ComplexHeatmap
- scran
- scDblFinder
- limma
- clustifyr
- slingshot
- tradeSeq
- clusterExperiment
From github:
- destiny (hosted on bioconductor typically but not building correctly right now) - harmony (batch correction approach) - LaCroixColoR (pretty color palette)
remotes::install_github('theislab/destiny')
remotes::install_github('immunogenomics/harmony')
remotes::install_github('johannesbjork/LaCroixColoR')
To test the installation, run the prerequisite Rmarkdown which will load all of these packages.