CRAN Repository Mirror Usage Guide
info
Some content in this document may have been translated by AI.
CRAN Introduction
CRAN is a network of ftp and Web servers around the world that store identical, up-to-date versions of R code and documentation.
Usage
Long-term Use
CRAN (The Comprehensive R Archive Network) mirror source configuration file is .Rprofile (located at ~/.Rprofile in linux).
操作方法:替换文件中的内容
替换文件1:~/.Rprofile
示例命令:
sed -i.bak "$a options("repos" = c(CRAN="http://mirrors.hust.edu.cn/CRAN/"))" ~/.Rprofile
Open R to use this CRAN mirror source to install R packages.
Temporary Use
Specify repo during installation, such as installing lattice:
install.packages("lattice", repos="https://mirrors.hust.edu.cn/CRAN/")