Skip to content

Instantly share code, notes, and snippets.

View Elaine-AL's full-sized avatar
🏢
Working from home

Elaine AL Elaine-AL

🏢
Working from home
View GitHub Profile
@Elaine-AL
Elaine-AL / update_migrate.R
Created February 22, 2021 13:09 — forked from arcaravaggi/update_migrate.R
Update R and migrate R packages to new installation from within the console
#From https://stackoverflow.com/questions/1401904/painless-way-to-install-a-new-version-of-r
# Run in the old version of R (or via RStudio)
setwd("C:/Temp/")
packages <- installed.packages()[,"Package"]
save(packages, file="Rpackages")
# INSTALL NEW R VERSION
if(!require(installr)) { install.packages("installr"); require(installr)} #load / install+load installr
# See here for more on installr: https://www.r-statistics.com/2013/03/updating-r-from-r-on-windows-using-the-installr-package/