6 Installing packages
All of the functions used up to this point were part of base R. They are built into the R language itself. Base R is extremely powerful, but R is also extensible. There are thousands of packages available for R.
The difficulty of installing these packages varies greatly. When possible, it is convenient to use Bioconductor, a repository of free open source R software for bioinformatics, which is updated twice a year, and includes stable versions of R packages that are useful for biological and data science projects.
Bioconductor itself has an R package that manages installation and updates of the software contained in the repository.
if (!("BiocManager" %in% rownames(installed.packages()))){
install.packages("BiocManager")
}if (!("ggplot2" %in% rownames(installed.packages()))){
::install("ggplot2")
BiocManager
}if (!("tidyr" %in% rownames(installed.packages()))){
::install("tidyr")
BiocManager
}if (!("dplyr" %in% rownames(installed.packages()))){
::install("dplyr")
BiocManager
}if (!("magrittr" %in% rownames(installed.packages()))){
::install("magrittr")
BiocManager
}if (!("viridis" %in% rownames(installed.packages()))){
::install("viridis")
BiocManager }