# Packages

> In computer programming, a package is a collection of modules or programs that are often published as tools for a range of common use cases, such as text processing and doing math. Programmers can install these packages and take advantage of their functionality within their own code.&#x20;

This page includes instructions for installing packages in R and a description of some of R's most frequently used packages.

## Installing Packages

To install a package in R, you can either:

* Use the install.packages("PackageName") function if you have the package downloaded locally on your machine
* Or if you are using RStudio, you can use Tools > Install packages, enter in the package name and click Install

Once you install the package, you have to load it into your library using the libary(PackageName) function.

```r
#Installing a package downloaded locally
install.packages("tidyverse")

#Once the package is installed, you have to load it
library(tidyverse)
```

## Helpful Packages

In R, tidyverse is one of the most popular packages, as it contains an assortment of packages used for data science, such as:&#x20;

* [ggplot2](https://ggplot2.tidyverse.org), used to create graphics and data visualization
* [dplyr](https://dplyr.tidyverse.org), contains functions used for data manipulation, like mutate() and filter()
* [tidyr](https://tidyr.tidyverse.org), used for data organization and cleaning
* [tibble](https://tibble.tidyverse.org), an optimized dataframe visualizer
* [readxl](https://readxl.tidyverse.org), can be used to input Excel files in .xlsx format into R

## Resources

* R Documentation: [Packages](https://cran.r-project.org/doc/manuals/r-release/R-intro.html#Packages)
* [Tidyverse](https://www.tidyverse.org)
