8.1 Load packages and import data
Let’s load some familiar packages first:
We also need the janitor
package, the ggmosaic
package, and the ggExtra
packages, and these are likely to be new to you. Check whether these packages are installed under the “packages” tab in the bottom-right panel in RStudio. If they are not yet installed, then install them. Only install them once on your computer!
Load the packages:
Import Data
We’ll again make use of the penguins
dataset, which gets loaded as a “tibble” object with the palmerpenguins
package.
Import the locusts.csv
data, which are described in the Whitlock & Schluter text, Figure 2.1-2. We’ll create a tibble called locust
.
## Rows: 30 Columns: 2
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## dbl (2): serotoninLevel, treatmentTime
##
## ℹ 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.
Import the bird.malaria.csv
data, which are described in the Whitlock & Schluter text, Example 2.3A (p. 40). We’ll create a tibble called bird.malaria
.
bird.malaria<- read_csv("https://raw.githubusercontent.com/ubco-biology/BIOL202/main/data/bird_malaria.csv")
## Rows: 65 Columns: 3
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (2): treatment, response
## dbl (1): bird
##
## ℹ 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.
- Get an overview of the
locust
andbird.malaria
tibbles.