---
title: "Matching patterns"
author: "Jeffrey R. Stevens"
date: "2023-03-10"
output: html_document
execute:
  freeze: auto
---

For these exercises, we'll use the dog breed traits data set. 

1. Load tidyverse, import [`dog_breed_traits_clean.csv`](https://jeffreyrstevens.quarto.pub/dpavir/data/dog_breed_traits_clean.csv) to `traits`, and extract the _breed_ column into an object called `breeds` that randomly shuffles the breeds using 12 as a seed for randomization.

```{r}
# >
```


2. View the breeds ending with the letter "s".

```{r}
# >
```


3. Create a logical vector showing whether breeds have at least two words in their names.

```{r}
# >
```


4. Extract the hounds (but don't release them). That is, return a vector of all breeds that include the string "hound" or "Hound".

```{r}
# >
```


5. Extract the breeds that include the following pattern "\<wildcard\>ep".

```{r}
# >
```


6. OK, maybe English Buttdragger isn't the proper AKC name for this breed. Replace English Buttdragger with English Chaser.

```{r}
# >
```


7. Replace all instances of "English" with "British" and then return the breeds that include "English" or "British" in them (to check our work).

```{r}
# >
```


8. Extract the Spaniels and then separate the breed names into different strings for each word and create a matrix out of it.

```{r}
# >
```

