Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. # Seamless way to reinstall all your R package after a major update
  2.  
  3. # Where are your packages installed?
  4. libpath = "~/R/x86_64-pc-linux-gnu-library/"
  5.  
  6. # Find the latest R version before we updated
  7. R_versions = list.files(libpath)
  8. latest_R_version = max(as.numeric(R_versions))
  9.  
  10. # List all packages installed in the latest version
  11. list_packages = list.files(paste0(libpath, latest_R_version))
  12.  
  13. # Install them
  14. install.packages(list_packages, dependencies = T)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement