From 18ea5be6ea40ffc218eba41e3f84fbba1618c059 Mon Sep 17 00:00:00 2001 From: Tan Ho Date: Wed, 25 Oct 2023 13:01:13 -0400 Subject: [PATCH] espn franchises coalesce nickname to name --- DESCRIPTION | 2 +- NEWS.md | 5 +++-- R/espn_franchises.R | 4 +++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index cc6b4a998..70517a5f4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: ffscrapr Title: API Client for Fantasy Football League Platforms -Version: 1.4.8.13 +Version: 1.4.8.14 Authors@R: c(person(given = "Tan", family = "Ho", diff --git a/NEWS.md b/NEWS.md index 9d3cd9f14..832005d57 100644 --- a/NEWS.md +++ b/NEWS.md @@ -19,10 +19,11 @@ and keep NA data where a player is not in a slot. (v1.4.8.07) (v1.4.8.10) - Use rlang::ns_env rather than superassign in onLoad - Refactor testing -- Bugfix sleeper draft picks using the wrong pick number (v1.4.8.11) -- Bugfix espn starter positions to have proper total starters (v1.4.8.12) (#415) +- Bugfix sleeper `ff_draft()` using the wrong pick number (v1.4.8.11) +- Bugfix espn `ff_starterpositions()` to have proper total starters (v1.4.8.12) (#415) - Bugfix ff_scoringhistory to handle new-format `load_rosters()` now that it returns row per player-team-season (v1.4.8.13) (thanks @john-b-edwards!) +- Bugfix espn `ff_franchises()` to return coalesce of name/nickname (v1.4.8.14) # ffscrapr 1.4.8 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(