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 set up domestic sources to speed up R package download

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article mainly introduces "how to set domestic sources to speed up R package download speed". In daily operation, I believe many people have doubts about how to set domestic sources to speed up R package download speed. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts of "how to set domestic sources to speed up R package download speed". Next, please follow the editor to study!

When R language installs package using install.packages (), it will search the official source (https://cran.rstudio.com/) for R package by default, and then download it to your computer or server. However, the official source is not in China, and the download speed is often greatly limited, so when we install R, the first step should be to change the installation source of R to a domestic source (also known as Mirror).

one

Modify the installation source of install.packages if you are using RGui with a graphical interface, select Packages-> Set CRAN mirror-> China (Guangzhou)

If you are using Rstudio, select Tools-- > Global options-- > Packages, click Change, and select the domestic source closest to your city

You can also enter the following code (suitable for R without graphical interface) and modify it directly

Options (repos=structure (c (CRAN= "https://mirrors.tuna.tsinghua.edu.cn/CRAN/")))) can know where the current mirror site is through the getOption (" repos ") command

two

Modify the installation source of bioconductor

Most of the bioinformatics-related R packets (such as DESeq2, limma, clusterProfiler) are in bioconductor, not in the official source, so the corresponding R packets can not be found through the install.packages () command. You have to install it using the following command:

If (! requireNamespace ("BiocManager", quietly = TRUE)) install.packages ("BiocManager") BiocManager::install ("DESeq2")

Similarly, if you use the option command to change the source of bioconductor to a domestic source, you will no longer have to endure the tortoise speed of bioconductor, as follows: options (BioC_mirror= "https://mirrors.tuna.tsinghua.edu.cn/bioconductor"))

At this point, the study on "how to set up domestic sources to speed up the download speed of R packets" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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