在Rprofile.site文件中设置R的镜像站点

来源:互联网 发布:sql注入实例 编辑:程序博客网 时间:2024/04/27 11:24

在Rprofile.site文件中设置R的镜像站点

好像R的官方站点被墙了,导致每次通过install.packages安装包都出现错误

可以再Rprofile.site文件中设置国内的镜像站点.

Windows中该文件在C:\Program Files\R\R-2.9.2\etc目录中,(这是我的安装位置,仅供参考)

按下面修改

# set a CRAN mirror
 local({r <- getOption("repos")
       r["CRAN"] <- "http://cran.csdb.cn/"
       options(repos=r)}


国内的镜像站点有

China
http://ftp.ctex.org/mirrors/CRAN/CTEX.ORGhttp://cran.csdb.cn/Computer Network Information Center, CAS, Beijinghttp://mirror.bjtu.edu.cn/cranBeijing Jiaotong University, Beijinghttp://mirrors.ustc.edu.cn/CRAN/University of Science and Technology of Chinahttp://mirrors.xmu.edu.cn/CRAN/Xiamen University