Import/Export R packages

On your old system:

setwd("/Users/USER/Desktop/folder")
packages <- as.data.frame(installed.packages())
write.csv(packages, 'packages.csv')

Then on your new system:

packages <- read.csv(file.path('packages.csv'))[, -1]
base_packages <- as.data.frame(installed.packages())
to_install <- setdiff(packages$Package, base_packages$Package)
install.packages(to_install)

https://robertochiosa.medium.com/import-export-r-packages-a6a122005e00


Leave a comment

Discover more from /root

Subscribe now to keep reading and get access to the full archive.

Continue reading