Skip to content

Commit

Permalink
espn/coalesce-nickname-to-name
Browse files Browse the repository at this point in the history
  • Loading branch information
tanho63 committed Oct 25, 2023
1 parent 791a885 commit 33cbd79
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/espn_franchises.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,16 @@ 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",
"user_id" = "primaryOwner"
) %>%
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(
Expand Down

0 comments on commit 33cbd79

Please sign in to comment.