Methods for Installing R Packages from the Linux Terminal

Under normal circumstances, I would enter the R interactive environment from the Linux terminal to installR packages:

R # Enter R environment

BiocManager::install(“ggplot2“) # Run the installation command in R

q() # Exit after installation is complete

Today, I will share with you the method of directly installing R packages from the Linuxterminal:

Method 1: Direct installation using conda

conda install -c conda-forge r-biocmanager

conda install -c bioconda bioconductor-ggplot2

Method 2: Single-line R command installation

R -e “BiocManager::install(‘ggplot2‘)”

R -e “install.packages(‘ggplot2’)”

Leave a Comment