Skip to content

Commit

Permalink
catch gt deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcaseb committed Oct 15, 2024
1 parent fac73ed commit 015ae12
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Imports:
tibble,
tidyr
Suggests:
gt,
gt (>= 0.9.0),
knitr,
nflplotR (>= 1.2.0),
rmarkdown,
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

* Fixed error in `simulate_nfl()` where it crashes because the "fake schedule" isn't a tibble. (#43)
* The `summary` method `summary.nflseedR_simulation()` explicitly sets the columns width of the logo column because those columns are hidden in some unclear scenarios.
* New function `nfl_standings()` for high efficient standings calculation. The functions `compute_division_ranks()`, `compute_conference_seeds()`, and `compute_draft_order()` will be deprecated in a future release.
* The `summary` method `summary.nflseedR_simulation()` now requires gt version v0.9.0 or higher to avoid warnings about deprecated arguments.

# nflseedR 1.2.0

Expand Down
6 changes: 3 additions & 3 deletions R/summary_nflseedR.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#' @export
summary.nflseedR_simulation <- function(object, ...){
rlang::check_installed(
c("gt", "scales (>= 1.2.0)", "nflplotR (>= 1.2.0)"),
c("gt (>= 0.9.0)", "scales (>= 1.2.0)", "nflplotR (>= 1.2.0)"),
"to compute a summary table."
)

Expand Down Expand Up @@ -145,14 +145,14 @@ summary.nflseedR_simulation <- function(object, ...){
gt::ends_with("won_conf"),
gt::ends_with("won_sb")
),
colors = scales::col_numeric(palette = table_colors_positive, domain = c(0, 1))
fn = scales::col_numeric(palette = table_colors_positive, domain = c(0, 1))
) %>%
gt::data_color(
columns = c(
gt::ends_with("draft1"),
gt::ends_with("draft5")
),
colors = scales::col_numeric(palette = table_colors_negative, domain = c(0, 1))
fn = scales::col_numeric(palette = table_colors_negative, domain = c(0, 1))
) %>%
nflplotR::gt_nfl_logos(locations = gt::cells_body(gt::ends_with("team"))) %>%
gt::tab_source_note("nflseedR") %>%
Expand Down

0 comments on commit 015ae12

Please sign in to comment.