Skip to content

Commit

Permalink
espn franchises 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 18ea5be
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
5 changes: 3 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
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 18ea5be

Please sign in to comment.