previously installed package retrieval feature is currently available only if launching updateR from base R rather than IDE like Rstudio. previously installed package retrieval feature is in beta mode and you may need to manually install back your packages after upgrading R version. Thanks God they are free :)
updateR is not currently on CRAN. To install it, you can use the devtools package:
install.packages("devtools")
devtools::install_github("AndreaCirilloAC/updateR")To update R, simply run updateR(). Updating R requires admin privileges, and the package will ask for your account password to check for this. The function will display the version that R has been updated to when it finishes.
updateR(auto = TRUE, .Rprofile = NULL) automatically checks for update in each R session via ~/.Rprofile. If you already have your own .Rprofile, change .Rprofile argument to /path/to/.Rprofile. You could simply turn it off by setting auto to FALSE.
If the first character of your admin password is \, make sure enter an extra \ before passing your admin password to updateR() to escape UNICODE characters coding, such as "\123"becomes "S" so you need to key in "\\123" for the actual "\123".
updateR only checks compatibility for the latest update available on CRAN. Some of the patch/minor releases will be skipped, depending on the update of the website. For those who runs a macOS lower than 10.13, an compatibility error will be returned if run updateR():
Error: Latest R Version 4.0.2 requires macOS at least 10.13 or higher,
but 10.12 is running. Consider upgrading macOS or install legacy R binaries from
http://cran.rstudio.com/bin/macosx/
{updateR} restores old libraries from previous version with the following actions, depending the type of releases:
- For major releases (R 3.x -> R 4.x), reinstall all the packages;
- For minor releases (R 3.5.x -> R 3.6.x), users may choose between reinstall or copy and paste all the file folders under /Library/Frameworks/R.framework/Versions/[old_version]/library to /Library/Frameworks/R.framework/Versions/[new_version]/library;
- For patch releases (R 4.0.1 -> R 4.0.2), no actions will be taken.
To find out more on updateR, see the dedicated blog post: http://www.andreacirillo.com/2018/03/10/updater-package-update-r-version-with-a-function-on-mac-osx/