Is it wise to install ALL the packages in CRAN ?

[This article was first published on R Programming Blog, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

First off, here is how you can install all R Packages in one go:

packs <- installed.packages() # Get the currently installed packages

exc <- names(packs[,’Package’])  # Get the names in a vector

av <- names(available.packages()[,1]) #Get names of available packages in Cran

ins <- av[!av %in% exc] #Make a list of all packages that you havent installed

install.packages(ins) # Install the desired packages

It could takes a couple of hours based on your processor speed to complete the entire operation. But is it worth it? Lets take a closer look.

Coming to topic, the immediate assumption is that it will to slow down the computing performance and the processig speed somehow gets affected. Well, thats not how I’ve seen it work. What happens in reality is, it just consumes so much of space in your hard drive as the size of the packages. Under normal circumstances that is not a big ask. R Packages usually occupy a few MBs of space that is well justified for the value it brings to table.

But on the other hand, if you are an R enthusiast who constantly explore new packages or work on multiple projects and solve problems, it could save you time and frustration to load your package right away and start using the functions than to install new packages and dependencies every other time. If you think about it, What makes R what it is today is the rich collection of packages and structured documentation that go along. The ability to exploit the available resources can be a potent weapon to any problem solving that we may face.

I use a PC with 8GB ram and about 1 TB HD space.

The above is generally my experience so far. If you have other opinions please feel free to leave a comment.

Author: Selva Prabhakaran Sanjeevi Julian

Selva Prabhakaran


To leave a comment for the author, please follow the link and comment on their blog: R Programming Blog. offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)