From 33cbd790d34390af393bc1a3623ec7d3bd103b7d Mon Sep 17 00:00:00 2001 From: Tan Ho Date: Wed, 25 Oct 2023 13:01:13 -0400 Subject: [PATCH] espn/coalesce-nickname-to-name --- R/espn_franchises.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/espn_franchises.R b/R/espn_franchises.R index 22ba16b40..ce7ab82fe 100644 --- a/R/espn_franchises.R +++ b/R/espn_franchises.R @@ -37,6 +37,7 @@ ff_franchises.espn_conn <- function(conn) { "franchise_id" = "id", "franchise_abbrev" = "abbrev", "franchise_location" = "location", + "franchise_name" = "name", "franchise_nickname" = "nickname", "logo" = "logo", "waiver_order" = "waiverRank", @@ -44,7 +45,8 @@ ff_franchises.espn_conn <- function(conn) { ) %>% dplyr::left_join(members, by = c("user_id" = "user_id")) %>% dplyr::mutate( - franchise_name = paste(.data$franchise_location, .data$franchise_nickname) + franchise_nickname = paste(.data$franchise_location, .data$franchise_nickname), + franchise_name = dplyr::coalesce(.data$franchise_nickname, .data$franchise_name), ) %>% dplyr::select( dplyr::any_of(c(