From 70f379aa7be9c1d189d56d7bc70fe2f3d0aad6f9 Mon Sep 17 00:00:00 2001 From: mrcaseb Date: Wed, 2 Nov 2022 17:14:47 +0100 Subject: [PATCH] new dplyr throws warning if a join creates new rows we'll just bind_cols and drop game_id as well --- R/helper_scrape_nfl.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/helper_scrape_nfl.R b/R/helper_scrape_nfl.R index 60e81e78..157598b4 100644 --- a/R/helper_scrape_nfl.R +++ b/R/helper_scrape_nfl.R @@ -178,7 +178,7 @@ get_pbp_nfl <- function(id, dir = NULL, qs = FALSE) { pbp_stats <- dplyr::bind_rows(pbp_stats) combined <- game_info %>% - dplyr::left_join(plays %>% dplyr::select(-"playStats"), by = c("game_id")) %>% + dplyr::bind_cols(plays %>% dplyr::select(-"playStats", -"game_id")) %>% dplyr::left_join(drives, by = c("driveSequenceNumber" = "drive_order_sequence")) %>% dplyr::left_join(pbp_stats, by = c("playId" = "play_id")) %>% dplyr::mutate_if(is.logical, as.numeric) %>%