更新R,大部分都推荐打开RGui跑一下下面代码
install.packages(“installr”)
library(installr)
updateR()
当报错时,大多是没有设置好镜像,可以采用以下
updateR(fast=TRUE,cran_mirror=“https://mirrors.tuna.tsinghua.edu.cn/CRAN/”)
#这里我选择用清华的镜像,大家可以选择自己喜欢的,离自己越近越好
#国内镜像列表如下
China
https://mirrors.tuna.tsinghua.edu.cn/CRAN/ TUNA Team, Tsinghua University
https://mirrors.bfsu.edu.cn/CRAN/ Beijing Foreign Studies University
https://mirrors.pku.edu.cn/CRAN/ Peking University
https://mirrors.ustc.edu.cn/CRAN/ University of Science and Technology of China
https://mirror-hk.koddos.net/CRAN/ KoDDoS in Hong Kong
https://mirrors.e-ducation.cn/CRAN/ Elite Education
https://mirror.lzu.edu.cn/CRAN/ Lanzhou University Open Source Society
https://mirrors.nju.edu.cn/CRAN/ eScience Center, Nanjing University
h