Installing and updating packages in R

R language

Single package installation can be performed with


For example,


Usually, R will install package dependencies. For some larger packages with a long chain of dependencies, such as the caret package,

install.packages("caret", dependencies=c("Depends", "Suggests"))

Note – this can take a non-trivial amount of time and bandwidth depending on the complexity of the package.

To see what packages are installed:


To update currently installed packages,


This will update the installed packages, but prompt you upon updating each. To update all without prompting,


Be the first to comment

Leave a Reply

Your email address will not be published.