Forked from florianhartig/copyInstalledPackages.r
Last active
December 28, 2018 16:10
-
-
Save pavank/e550c56173d0d79a670b82a55bf25da2 to your computer and use it in GitHub Desktop.
Script to copy the packages installed on one computer or R version to another. Originally from http://stackoverflow.com/questions/1401904/painless-way-to-install-a-new-version-of-r-on-windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run on win computer / r version | |
setwd("C:/Users/pavan/RLibrary/") # or any other existing temp directory | |
packages <- installed.packages()[,"Package"] | |
save(packages, file="Rpackages") | |
# run on ubuntu computer / r version | |
setwd("/RLibrary") # or any other existing temp directory | |
load("Rpackages") | |
for (p in setdiff(packages, installed.packages()[,"Package"])) | |
install.packages(p) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment