Rstudio中更新R

在Rstudio中更新R

install.packages("installr")
library(installr)
updateR()

出现下列错误

> updateR()
Error in file(con, "r") : 无法打开链结
此外: Warning message:
In file(con, "r") : InternetOpenUrl失败:’操作超时'

好像是因为镜像在国内的问题,所以加个镜像链接

updateR(fast=TRUE,cran_mirror="https://mirrors.ustc.edu.cn/CRAN/")

于是就成功了

> updateR(fast=TRUE,cran_mirror="https://mirrors.ustc.edu.cn/CRAN/")
There is a newer version of R for you to download!

You are using R version:    	 4.0.2 (2020-06-22)
And the latest R version is:	 4.0.3 (2020-10-10)
------------------------
It is best to run 'updateR()' from Rgui and not from RStudio. Would you like to abort the installation and run it again from RGui? 

1: Yes
2: No

Selection: 2

这里在问是否要选择在Rgui里更新,选是的话需要在Rgui里重新更新,而选否可以直接更新,所以当然毫不犹豫选个2,出错再说!
选完过一会儿会有安装程序自启动,就按照官网下载安装步骤,下一步下一步下一步就ok

Installing the newest version of R,
 please wait for the installer file to be download and executed.
 Be sure to click 'next' as needed...
试开URL’https://mirrors.ustc.edu.cn/CRAN/bin/windows/base/R-4.0.3-win.exe'
Content type 'application/octet-stream' length 88237960 bytes (84.2 MB)
downloaded 84.2 MB

The file was downloaded successfully into:
 C:\Users\Lenovo\AppData\Local\Temp\RtmpUlSTeZ/R-4.0.3-win.exe 

Running the installer now...
----------------------- 
I am now copying  138  packages from: D:/R/R-4.0.2/library  ; into:  D:/R/R-4.0.3/library----------------------- 
===================== 
Done. We finished copying all the packages to the new location
[1] TRUE

看样子是更新好了
在global options里选择新的版本,再重新启动。
在这里插入图片描述
成功换新。
在Rstudio里安装就是不用重装包,方便多了。

  • 6
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值