1. Import your data

Import two related datasets from TidyTuesday Project.

survivalists <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2023/2023-01-24/survivalists.csv')
## Rows: 94 Columns: 16
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (10): name, gender, city, state, country, reason_tapped_out, reason_cate...
## dbl  (5): season, age, result, days_lasted, day_linked_up
## lgl  (1): medically_evacuated
## 
## ℹ 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.
loadouts <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2023/2023-01-24/loadouts.csv')
## Rows: 940 Columns: 6
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (4): version, name, item_detailed, item
## dbl (2): season, item_number
## 
## ℹ 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.

2. Make data small

Describe the two datasets:

Data1: Survivalist

Data 2: Loadouts

survivalists_small <- survivalists %>% select(season, name, age) %>% sample_n(10)
loadouts_small <- loadouts %>% select(season, name, item_detailed) %>% sample_n(10)

survivalists_small
## # A tibble: 10 × 3
##    season name            age
##     <dbl> <chr>         <dbl>
##  1      8 Colter Barnes    36
##  2      8 Nate Weber       47
##  3      3 Dan Wowak        34
##  4      3 Jim Shields      37
##  5      9 Terry Burns      30
##  6      5 Dave Nessia      50
##  7      1 Josh Chavez      31
##  8      3 Greg Ovens       53
##  9      7 Keith Syers      45
## 10      7 Roland Welker    47
loadouts_small
## # A tibble: 10 × 3
##    season name                    item_detailed                                 
##     <dbl> <chr>                   <chr>                                         
##  1      2 Jose Martinez Amoedo    2 quart cast iron pot with lid                
##  2      3 Zachary Gault           Sharpening Stone: 2 sided: coarse diamond & s…
##  3      8 Clay Hayes              Pot                                           
##  4      8 Biko Wright             Ferro rod                                     
##  5      8 Theresa Emmerich Kamper Fishing line and hooks                        
##  6      9 Igor Limansky           Axe                                           
##  7      9 Jessie Krebs            Paracord                                      
##  8      1 Joe Robinet             Large knife                                   
##  9      8 Jordon Bell             Snare wire                                    
## 10      4 Jesse Bosdell           Saw

3. inner_join

Describe the resulting data:

How is it different from the original two datasets? 1 row vs 10 rows

survivalists_small %>% inner_join(loadouts_small, )
## Joining with `by = join_by(season, name)`
## # A tibble: 0 × 4
## # ℹ 4 variables: season <dbl>, name <chr>, age <dbl>, item_detailed <chr>

4. left_join

Describe the resulting data:

How is it different from the original two datasets?

5. right_join

Describe the resulting data:

How is it different from the original two datasets?

6. full_join

Describe the resulting data:

How is it different from the original two datasets?

7. semi_join

Describe the resulting data:

How is it different from the original two datasets?

8. anti_join

Describe the resulting data:

How is it different from the original two datasets?