Packages

Author

Marie-Hélène Burle

Packages are a set of functions, constants, and/or data developed by the community that add functionality to R.

In this section, we look at where to find packages and how to install them.

Looking for packages

Package documentation

Managing R packages

R packages can be installed, updated, and removed from within R:

install.packages("package-name")
remove.packages("package-name")
update_packages()

Loading packages

To make a package available in an R session, you load it with the library() function.

Example:

library(readxl)

Alternatively, you can access a function from a package without loading it with the syntax: package::function().

Example:

readxl::read_excel("file.xlsx")