Using R packages can be fun but installing them can be difficult sometimes. The problem usually happens when the installation needs dev tools or some from one of the bioconductor repository. Usually the instructions are as below.
install.packages("devtools")
install.packages("BiocManager")
# Install package here
devtools::install_github("xxxx/xxxx",
dependencies = c("Depends", "Imports", "LinkingTo"),
repos = c("https://cloud.r-project.org/",
BiocManager::repositories()))
Using github PAT from envvar GITHUB_PAT
Error: Failed to install 'SPRING' from GitHub:
HTTP error 401.
Bad credentials
Rate limit remaining: 59/60
Rate limit reset at: 2023-06-23 04:15:37 UTC
- Download the zip file and save it locally.
- Unzip the file and remove the master prefix. For example, in NetCoMi-main.zip, remove the "-main" part. Now, drag the file into terminal or type
- This will prepare the file for installation and will result into NetCoMi_1.1.0.tar.gz file. Now this is the folder that is ready to get install on your computer. Install it using this command.
R CMD INSTALL NetCoMi_1.1.0.tar.gz
Now you will realize that it will fail sometimes because of the dependencies are not installed. Either install them using the same method I am describing or use the install.package() function. Repeat until the package can be installed.
For Bioconductor hosted packages:
- Go to https://www.bioconductor.org/about/release-announcements/. Look under software packages column on the right. Search for the package of interest.
- Another way to search and download is to use https://code.bioconductor.org/browse/ and search for specific package and look for commit history to go to the actual version such as https://code.bioconductor.org/browse/ANCOMBC/commit/543c77a2eb67f9b781ba8fe585932dee45d4d452 which lets you go to that commit point and download, build and install package as described above.
- There is also mirror Bioconductor repo such as https://bioconductor.statistik.tu-dortmund.de/packages/3.15/bioc/src/contrib/Archive/ANCOMBC/
Bottom line is to make sure to note all the packages that are used for the analysis since sometimes updates can change your analysis output.