Load a package library in R

Once the package is installed, to use it, you load the package library at the top of your script like this:

# load libraries
library(package_name)

Note that you don’t need to use quotes around the package name when you call it using the library() function. But you do need the quotes when you install a package.

When you load a package (look at it like a library of functions) in R, you are telling R to make all of the FUNCTIONS in the package available to you in your code.

When you work with your datasets in R later, you will always load all relevant packages before you start running any other code.