# 3.9: Using R Libraries


Many of the useful features in R are not contained in the primary R package, but instead come from libraries that have been developed by various members of the R community. For example, the ggplot2 package provides a number of features for visualizing data, as we will see in a later chapter. Before we can use a package, we need to install it on our system, using the install.packages() function:

> install.packages("ggplot2")
trying URL 'https://cran.rstudio.com/...
Content type 'application/x-gzip' length 3961383 bytes (3.8 MB)
==================================================


This will automatically download the package from the Comprehensive R Archive Network (CRAN) and install it on your system. Once it’s installed, you can then load the library using the library() function:
> library(ggplot2)
> help(ggplot2)