Skip to content

Commit

Permalink
Merge pull request #340 from JaseZiv/fix-na-goals
Browse files Browse the repository at this point in the history
Fix `NA` goals returned from `fb_match_results`
  • Loading branch information
JaseZiv committed Nov 5, 2023
2 parents 9914697 + 01ae55a commit 62ce06f
Show file tree
Hide file tree
Showing 3 changed files with 4 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: worldfootballR
Title: Extract and Clean World Football (Soccer) Data
Version: 0.6.4.0010
Version: 0.6.4.0011
Authors@R: c(
person("Jason", "Zivkovic", , "[email protected]", role = c("aut", "cre", "cph")),
person("Tony", "ElHabr", , "[email protected]", role = "ctb"),
Expand Down
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* `fb_advanced_match_stats()` throwing errors when there were no stat tables available for matches (0.6.4.0002) [#315](https://github.com/JaseZiv/worldfootballR/issues/315)
* `fb_player_match_logs()` failing for players who have played on multiple teams/leagues in the same season (0.6.4.0006) [#327](https://github.com/JaseZiv/worldfootballR/issues/327)
* `fb_league_stats(team_or_player = "player")` returning duplicate player hrefs (0.6.4.0008) [#331](https://github.com/JaseZiv/worldfootballR/issues/331)
worldfootballR/issues/327)
* `fb_league_stats(team_or_player = "player")` returning wrong season's data for Australian league (0.6.4.0009) [#333](https://github.com/JaseZiv/worldfootballR/issues/333)
* `tm_player_market_values()` returing the player name and valuation on separate rows in the `player_name` column [#338] (https://github.com/JaseZiv/worldfootballR/issues/338) and also returning `NA`s for the `player_age` column [#336](https://github.com/JaseZiv/worldfootballR/issues/336) (0.6.4.0010)
* `tm_player_market_values()` returing the player name and valuation on separate rows in the `player_name` column [#338] (https://github.com/JaseZiv/worldfootballR/issues/338) and also returning `NA`s for the `player_age` column (0.6.4.0010) [#336](https://github.com/JaseZiv/worldfootballR/issues/336)
* `fb_match_results()` returns `NA` goals due to inconsistent `iconv()` behvaior on different systems (0.6.4.0011) [#326](https://github.com/JaseZiv/worldfootballR/issues/326)


### Improvements
Expand Down
2 changes: 1 addition & 1 deletion R/get_match_results.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
suppressWarnings(
season_summary <- season_summary %>%
dplyr::filter(is.na(.data[["Time"]]) | .data[["Time"]] != "Time") %>%
dplyr::mutate(Score = iconv(.data[["Score"]], 'utf-8', 'ascii', sub=' ') %>% stringr::str_squish()) %>%
dplyr::mutate(Score = gsub("\u2013", " ", .data[["Score"]]) %>% stringr::str_squish()) %>%
tidyr::separate(.data[["Score"]], into = c("HomeGoals", "AwayGoals"), sep = " ") %>%
dplyr::mutate(HomeGoals = as.numeric(.data[["HomeGoals"]]),
AwayGoals = as.numeric(.data[["AwayGoals"]]),
Expand Down

0 comments on commit 62ce06f

Please sign in to comment.