Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install the R package hosted on GitHub

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the knowledge about "how to install R package hosted on GitHub". In the actual case operation process, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!

Step 1 Download the installation package from github (git bash command line download):

This actually needs to find a way, because the use of git bash command line download is still downloaded from github, if the speed is super bad, in fact, it is not feasible. This package has hundreds of M, you can use https://gitee.com/as a transit station:

#Because it is operated on a personal notebook, it is downloaded from the git bash command line.

git clone https://github.com/GreenleafLab/ArchR.git

Step 2 Install in R

The original tutorial is shown below

Enter code:

if (! requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager")

BiocManager::install(c("nabor","motifmatchr","chromVAR","ComplexHeatmap"))#Installation of dependent packages

install.packages("./ ArchR/",repos = NULL)

First of all, find the error:

First error

Read the wrong message, it should be a conflict in parameter settings, so try to remove the parameter is feasible **(a bit blind, not desirable)**

PS: In fact, the problem for students at this time is that they did not open rstudio in the download ArchR-master.zip folder, that is, they did not have the concept of working environment, and the relative path and absolute path were unclear.

As a result, a new error occurred:

Second error

Looking back at the installation of package R in the training course, this error may be due to the wrong installation package name or installation command. Since this was the first time I tried to install locally, I didn't have any experience, so I put the problem in the communication group. Very happy group teaching assistant teacher immediately pointed out that my command is wrong, he suggested that I install locally, try install_local command, so:

devtools::install_local("C:/Users/Big Meter/Desktop/ArchR-master/ArchR-master.zip")

Another error was reported:

Third error.

An error occurred during the installation of the dependency package and could not be written to the C:/Program Files/R/R-3.6.1/library path? A little confused. The last error "non-zero exit" error, Google a bit there are many possibilities, into confusion...

PS: This time can not be written, usually folder permissions problem, if you do not use the system administrator permissions to open R, you will encounter such trouble, or when installing the package, you can specify the installation path.

So back to the beginning, I want to solve the initial install.packages parameter setting problem. Comprehensive online tutorials, try a new approach:

install.packages("C:/Users/Large/Desktop/ArchR-master/ArchR/",repos = NULL, type="source")

Bingo!

Both parameters are important here! Paths can also be completed with Tab to reduce errors.

note

Local installation is often unsuccessful, because the dependencies between R packages are very strong, so learn to read error messages, will prompt what packages are not installed, then install dependent packages before continuing.

See that there is a way to view the dependencies of a package, which is the getDependency function:

install.packages("gtools")

library(gtools)

getDependencies("ArchR")

But this method does not work for a newly developed package like ArchR, and you still have to learn to read misinformation.

"How to install the R package hosted on GitHub" is introduced here. Thank you for reading it. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report