Import data

data <- read_csv("../00_data/survivalists.csv")

Make Data Small

data_small <- data %>%
    select(name, season, reason_tapped_out) %>%
    sample_n(10)
data_smaller <- data %>%
    select(name, season, days_lasted) %>%
    sample_n(10)
data_small
## # A tibble: 10 × 3
##    name           season reason_tapped_out            
##    <chr>           <dbl> <chr>                        
##  1 Jim Shields         3 Regretted leaving family     
##  2 Jordon Bell         8 Missed his family            
##  3 Colter Barnes       8 Low BMI, lost too much weight
##  4 Greg Ovens          3 Hypothermia                  
##  5 Josh Chavez         1 Fear of bears                
##  6 Alex Ribar          4 Were not mentally prepared   
##  7 David McIntyre      2 <NA>                         
##  8 Jessie Krebs        9 Stomach inflammation         
##  9 Nicole Apelian      5 MS attack                    
## 10 Wayne Russell       1 Fear of bears

full_join

data_small %>% full_join(data_smaller, by = c("name", "season"))
## # A tibble: 18 × 4
##    name            season reason_tapped_out             days_lasted
##    <chr>            <dbl> <chr>                               <dbl>
##  1 Jim Shields          3 Regretted leaving family               NA
##  2 Jordon Bell          8 Missed his family                      NA
##  3 Colter Barnes        8 Low BMI, lost too much weight          NA
##  4 Greg Ovens           3 Hypothermia                            NA
##  5 Josh Chavez          1 Fear of bears                          NA
##  6 Alex Ribar           4 Were not mentally prepared              2
##  7 David McIntyre       2 <NA>                                   NA
##  8 Jessie Krebs         9 Stomach inflammation                   NA
##  9 Nicole Apelian       5 MS attack                               9
## 10 Wayne Russell        1 Fear of bears                          NA
## 11 Brad Richardson      4 <NA>                                    1
## 12 Teimojin Tan         9 <NA>                                   63
## 13 Dustin Feher         1 <NA>                                    8
## 14 Nathan Donnelly      6 <NA>                                   72
## 15 Benki Hill           9 <NA>                                   27
## 16 Nate Weber           8 <NA>                                   24
## 17 Ray Livingston       6 <NA>                                   19
## 18 Justin Vititoe       2 <NA>                                   35

semi_join

data_small %>% semi_join(data_smaller, by = c("name" , "season"))
## # A tibble: 2 × 3
##   name           season reason_tapped_out         
##   <chr>           <dbl> <chr>                     
## 1 Alex Ribar          4 Were not mentally prepared
## 2 Nicole Apelian      5 MS attack

anti_join

data_small %>% anti_join(data_smaller, by = c("name" , "season"))
## # A tibble: 8 × 3
##   name           season reason_tapped_out            
##   <chr>           <dbl> <chr>                        
## 1 Jim Shields         3 Regretted leaving family     
## 2 Jordon Bell         8 Missed his family            
## 3 Colter Barnes       8 Low BMI, lost too much weight
## 4 Greg Ovens          3 Hypothermia                  
## 5 Josh Chavez         1 Fear of bears                
## 6 David McIntyre      2 <NA>                         
## 7 Jessie Krebs        9 Stomach inflammation         
## 8 Wayne Russell       1 Fear of bears