From bd262d5a3fef699a01627520106b80ffe0855860 Mon Sep 17 00:00:00 2001 From: mrcaseb Date: Fri, 19 Jan 2024 17:19:21 +0100 Subject: [PATCH 1/2] Make sure the fake schedule is a tibble --- DESCRIPTION | 2 +- R/simulate_nfl.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0d03cdb..8ade6bb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: nflseedR Title: Functions to Efficiently Simulate and Evaluate NFL Seasons -Version: 1.2.0 +Version: 1.2.0.9000 Authors@R: c( person("Lee", "Sharpe", role = c("aut", "cph")), person("Sebastian", "Carl", , "mrcaseb@gmail.com", role = c("cre", "aut")) diff --git a/R/simulate_nfl.R b/R/simulate_nfl.R index 11c491b..750953d 100644 --- a/R/simulate_nfl.R +++ b/R/simulate_nfl.R @@ -285,7 +285,7 @@ simulate_nfl <- function(nfl_season = NULL, ".csv?raw=true" ) tryCatch({ - schedule <- data.table::fread(fn) + schedule <- data.table::fread(fn) %>% tibble::as_tibble() cli::cli_alert_info("No actual schedule exists for {.val {nfl_season}}, using fake schedule with correct opponents.") }, error = function(cond) { cli::cli_abort("Unable to locate a schedule for {.val {nfl_season}}") From ddccf8f8c50df51a464210c9c2c87f1299351648 Mon Sep 17 00:00:00 2001 From: mrcaseb Date: Fri, 19 Jan 2024 17:22:21 +0100 Subject: [PATCH 2/2] news bullet --- NEWS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS.md b/NEWS.md index d8fb439..e96e41d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# nflseedR (development version) + +* Fixed error in `simulate_nfl()` where it crashes because the "fake schedule" isn't a tibble. (#43) + # nflseedR 1.2.0 * `simulate_nfl()` gained the new argument `sim_include` to allow more access to what is actually being simulated. This makes it possible skip playoff simulation or the (possibly heavy) computation of draft order. (#34)