Introducing Packages

Duration: ~5 Minutes

Clock made of Legos

Learning Objectives

  1. Define a package
  2. Install a package
  3. Load a package

What is a package?

Set of R functions to make your life easier


Examples

Install a package


## - Always plural
## - Package name in quotes
## - Capitalization matters

install.packages("tidyverse")
    

Load a package


## - Always singular
## - Quotes not needed
## - Capitalization matters

library(tidyverse)
    

Where to Find Packages

  • Over 10,000 packages on CRAN
  • BioConductor
  • GitHub

Popular Packages

How To Choose

Caveat emptor. Be judicious.

Look for:

  1. How well maintained?
  2. Can you judge the code yourself?
  3. Has anyone heard of the author?
  4. Peer reviewed articles? (sometimes)

Example: MatchIt on (CRAN) or its Website

And Now You Know!

Q & A

Next up: Tidyverse