Skip to content

Commit

Permalink
more devtools checking
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyelhabr committed Jan 21, 2024
1 parent 542602a commit c37466c
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 12 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Imports:
rlang (>= 0.4.11),
scales (>= 1.1.0)
Suggests:
purrr (>= 0.2.0),
testthat (>= 3.0.0)
Config/testthat/edition: 3
Encoding: UTF-8
Expand Down
6 changes: 3 additions & 3 deletions R/geom_soccer_logos.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
#' team_names <- soccerplotR::valid_team_names("ENG")
#'
#' df <- data.frame(
#' a = rep(1:6, 8),
#' b = sort(rep(1:8, 6), decreasing = TRUE),
#' team_name = c(team_names, rep(NA, 3))
#' a = c(rep(1:6, 7), c(1, 2)),
#' b = sort(c(rep(1:7, 6), c(8, 8)), decreasing = TRUE),
#' team_name = team_names
#' )
#'
#' # keep alpha == 1 for all teams including an 'A'
Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
13 changes: 11 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,19 @@ all_valid_team_names <- function() {
#' Non matches may be replaced with `NA` (depending on the value of `keep_non_matches`).
#' @export
#' @examples
#' team_names <- c('Liverpool', 'Brighton', 'Bournemouth', 'AFC Bournemouth')
#' \donttest{
#' team_names <- c('Bournemouth', 'AFC Bournemouth', 'Bournemouth AFC')
#'
#' # keep non matches
#' soccerplotR::clean_team_names(team_names, keep_non_matches = TRUE)
#' soccerplotR::clean_team_names(team_names)
#'
#' # drop "bad" names
#' soccerplotR::clean_team_names(team_names, keep_non_matches = FALSE)
#'
#' # silence warnings
#' # options(soccerplotR.verbose = FALSE)
#' soccerplotR::clean_team_names(team_names)
#' }
clean_team_names <- function(
team_name,
keep_non_matches = TRUE
Expand Down
2 changes: 1 addition & 1 deletion data-raw/build_internal_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ team_name_mapping[['ENG']] <- c(
'Swansea City' = 'Swansea',
'West Bromwich Albion' = 'West Brom',
'West Ham United' = 'West Ham',
'Wigan Athletic' = 'Wigan',
# 'Wigan Athletic' = 'Wigan',
'Wolverhampton Wanderers' = 'Wolves',
## Opta
'WBA' = 'West Brom'
Expand Down
Binary file modified data/team_name_mapping.rda
Binary file not shown.
13 changes: 11 additions & 2 deletions man/clean_team_names.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/geom_soccer_logos.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pkgdown/_pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ reference:
desc: >
Various helper functions.
contents:
- clean_team_abbrs
- clean_team_names
- all_valid_team_names
- valid_team_names
- team_name_mapping

0 comments on commit c37466c

Please sign in to comment.