diff --git a/R/fb_match_results_cups/update_fb_cups_match_results.R b/R/fb_match_results_cups/update_fb_cups_match_results.R index cd5be2f..a7a7826 100644 --- a/R/fb_match_results_cups/update_fb_cups_match_results.R +++ b/R/fb_match_results_cups/update_fb_cups_match_results.R @@ -69,14 +69,14 @@ update_fb_comp_match_results <- function(each_comp) { dplyr::right_join(new_df, by = c("fixtures_url" = "fixture_url")) %>% dplyr::select(-.data[["seasons_urls"]], -.data[["fixtures_url"]]) %>% dplyr::mutate(Date = lubridate::ymd(.data[["Date"]])) %>% - dplyr::arrange(.data[["country"]], .data[["competition_name"]], .data[["gender"]], .data[["season_end_year"]], as.numeric(.data[["Wk"]]), .data[["Date"]], .data[["Time"]]) %>% dplyr::distinct(.keep_all = T) + dplyr::arrange(.data[["Country"]], .data[["Competition_Name"]], .data[["Gender"]], .data[["Season_End_Year"]], as.numeric(.data[["Wk"]]), .data[["Date"]], .data[["Time"]]) %>% dplyr::distinct(.keep_all = T) if(nrow(existing_df) != 0) { existing_df <- existing_df %>% anti_join(new_df_full, by = c("Gender", "Season_End_Year", "Tier")) new_df_full <- bind_rows(existing_df, new_df_full) %>% - dplyr::arrange(.data[["country"]], .data[["competition_name"]], .data[["gender"]], .data[["season_end_year"]], .data[["Date"]], .data[["Time"]], as.numeric(.data[["Wk"]])) %>% dplyr::distinct(.keep_all = T) + dplyr::arrange(.data[["Country"]], .data[["Competition_Name"]], .data[["Gender"]], .data[["Season_End_Year"]], .data[["Date"]], .data[["Time"]], as.numeric(.data[["Wk"]])) %>% dplyr::distinct(.keep_all = T) } attr(new_df_full, "scrape_timestamp") <- scrape_time_utc