How to install R packages

1. CRAN installation

For most R packages or packages that can be found on the R official website , you can install them directly.

  1. Install directly using code
    install packages("R包的名称")

  2. Search and install from the R—packages interface, enter the R package name, search, and click "Install" to install. After the installation progress is completed, it will display that the installation is successful.

2. Bioconductor installation

if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install("org.Hs.eg.db")


3. Github installation

Use the "install_github()" function in the devtools package to install.

library(devtools)
install_github("schymane/ReSOLUTION")

4. Manual installation

For some packages that are difficult to install, or packages that report errors, we can choose to install them manually. Here are two typical examples

1 BiocManager::install("org.Hs.eg.db")

For example, for this package, we manually downloaded the installation package from the wrong address

https://bioconductor.org/packages/3.13/data/annotation/src/contrib/org.Hs.eg.db_3.13.0.tar.gz

Then install it manually

install.packages("~/R/org.Hs.eg.db_3.13.0.tar.gz", repos = NULL, type = "source")

 

2 devtools::install_github("iaconogi/bigSCale2")

Download the installation package according to this address, and then install it manually. If the installation is unsuccessful, check the error message. If some dependencies are not installed, install these dependencies and then reinstall the initial package.

 

 

 

 

Guess you like

Origin blog.csdn.net/weixin_56845253/article/details/130108148