如何通过RStudio更新R ?
当前回答
我发现对我来说,在Linux下保持最新状态的最佳永久解决方案是安装r补丁项目。这将使你的R安装保持最新,你甚至不需要在安装之间移动你的包(这在RyanStochastic的回答中有描述)。
对于openSUSE,请参见此处的说明。
其他回答
在安装R的新版本后,只需重新启动R Studio。要确认您使用的是>版本的新版本,您应该会看到新的详细信息。
如果你使用的是Mac电脑,你可以使用新的updateR包从RStudio更新R版本:http://www.andreacirillo.com/2018/02/10/updater-package-update-r-version-with-a-function-on-mac-osx/
总之,您需要执行以下操作:
要在Rstudio中使用updateR更新你的R版本,你只需要运行这五行代码: Install.packages ('devtools') #假设尚未安装 库(devtools) install_github (andreacirilloac /更新) 库(更新) updateR(admin_password = 'Admin用户密码') 在安装过程结束时,一条消息将确认你的幸福结局: 一切都很顺利 打开一个Terminal会话并运行'R'来断言已经安装了最新版本
如果您使用的是windows,则可以使用安装程序。 示例用法
将其粘贴到控制台并运行命令:
## How to update R in RStudio using installr package (for Windows)
## paste this into the console and run the commands
## "The updateR() command performs the following: finding the latest R version, downloading it, running the installer, deleting the installation file, copy and updating old packages to the new R installation."
## more info here: https://cran.r-project.org/web/packages/installr/index.html
install.packages("installr")
library(installr)
updateR()
## Watch for small pop up windows. There will be many questions and they don't always pop to the front.
## Note: It warns that it might work better in Rgui but I did it in Rstudio and it worked just fine.
您可以从官方网站上安装一个新版本的R。
当您重新启动RStudio时,它将自动以新版本启动。
如果您需要手动执行,在RStudio中,请转到:工具->选项->通用。
查看@micstr的答案,了解更详细的攻略。