7.1 Load packages and import data

Let’s load some packages first:

library(tidyverse)
library(palmerpenguins)
library(skimr)
library(knitr)
library(janitor)

And we’re introducing a new package called naniar, which helps us deal more easily with missing values in datasets.

You may need to install that package (recall you only do this once!). Consult a previous tutorial if you forget how.

Once you’ve installed it, load it:

library(naniar)

We will use the following datasets in this tutorial:

  • the birds.csv file contains counts of different categories of bird observed at a marsh habitat
  • the penguins dataset that is available as part of the palmerpenguins package
birds <- read_csv("https://raw.githubusercontent.com/ubco-biology/BIOL202/main/data/birds.csv")
## Rows: 86 Columns: 1
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): type
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.