使用updateR()函数: 为用户检测最新版本的r, 如果当前安装的不是最新版本,即可下载安装。
updateR()用法
updateR(fast = FALSE, browse_news, install_R, copy_packages,
copy_Rprofile.site, keep_old_packages, update_packages, start_new_R,
quit_R, print_R_versions = TRUE, GUI = TRUE,
to_checkMD5sums = FALSE, keep_install_file = FALSE,
download_dir = tempdir(), silent = FALSE, setInternet2 = TRUE,
cran_mirror = "https://cran.rstudio.com/", ...)
updateR()会执行以下的功能:
- Check what is the latest R version. If the current installed R version is up-to-date, the function ends (and returns FALSE)
- If a newer version of R is available, the user is asked if to review the NEWS of the latest R version - in order to decide if to install the newest R or not.
- If the user wishes to - the function will download and install it. (you will need to press the "next" buttons on your own)
- Once the installation is done, you should press "any-key", and the function will proceed with copying all of your packages from your old (well, current) R installation, into your newer R installation.
- You can then erase all of the packages in your old R installation.
- After your packages are moved (and the old ones possibly erased), you will get the option to update all of your packages in the new version of R.
- You will be asked if to open the Rgui of your new R.
- Lastly - you can close the current session of your old R.
windows系统
#R版本查看
version
#已安装的R包查看
packageStatus()
#安装installr包
install.packages("installr")
require(installr)
#更新
updateR()
#R版本查看
version
mac系统
install.packages("devtools")
library("devtools")
devtools::install_github("AndreaCirilloAC/updateR")
library(updateR)
updateR(admin_password = '用户系统密码')
网友评论