Skip to content

Commit

Permalink
Version 1.2.0 (#41)
Browse files Browse the repository at this point in the history
* Increment version number to 1.2.0

* wrap examples in try

* readme and cran comments

* spelling
  • Loading branch information
mrcaseb authored Feb 19, 2023
1 parent 270dcb7 commit 51641bf
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: nflseedR
Title: Functions to Efficiently Simulate and Evaluate NFL Seasons
Version: 1.1.0.9002
Version: 1.2.0
Authors@R: c(
person("Lee", "Sharpe", role = c("aut", "cph")),
person("Sebastian", "Carl", , "[email protected]", role = c("cre", "aut"))
Expand Down
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# nflseedR (development version)
# 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)
* The `summary` method `summary.nflseedR_simulation()` now hides columns where all values are `NA`. This is useful if `simulate_nfl()` skips the postseason or draft order. The method also reformats the number of simulations in the subtitle, e.g. from "10000" to "10k" (this requires scales >= 1.2.0, but it is a good idea to update scales anyways). (#35)
* The `summary` method `summary.nflseedR_simulation()` now hides columns where all values are `NA`. This is useful if `simulate_nfl()` skips the postseason or draft order. The method also re-formats the number of simulations in the subtitle, e.g. from "10000" to "10k" (this requires scales >= 1.2.0, but it is a good idea to update scales anyways). (#35)
* `simulate_nfl()` now uses data.table to combine simulation rounds data. This is a significant performance improvement. The returned list `"sim_params"` now includes the package version of nflseedR (for debugging) and the current system time when the simulation was finished. (#36)
* Lots of internal improvements to reduce package dependencies and messaging. (#36)
* The `summary` method `summary.nflseedR_simulation()` now uses `fmt_pct_special()` to format probability strings to avoid the impression of overconfidence by rounding to integer percentages. (#37)
Expand Down
2 changes: 2 additions & 0 deletions R/compute_conference_seeds.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
#' old <- options(list(digits = 3, tibble.print_min = 64))
#' library(dplyr, warn.conflicts = FALSE)
#'
#' try({#to avoid CRAN test problems
#' nflseedR::load_sharpe_games() %>%
#' dplyr::filter(season %in% 2019:2020) %>%
#' dplyr::select(sim = season, game_type, week, away_team, home_team, result) %>%
#' nflseedR::compute_division_ranks() %>%
#' nflseedR::compute_conference_seeds(h2h = .$h2h) %>%
#' purrr::pluck("standings")
#' })
#'
#' # Restore old options
#' options(old)
Expand Down
2 changes: 2 additions & 0 deletions R/compute_division_ranks.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,13 @@
#' old <- options(list(digits = 3, tibble.print_min = 64))
#' library(dplyr, warn.conflicts = FALSE)
#'
#' try({#to avoid CRAN test problems
#' nflseedR::load_sharpe_games() %>%
#' dplyr::filter(season %in% 2019:2020) %>%
#' dplyr::select(sim = season, game_type, week, away_team, home_team, result) %>%
#' nflseedR::compute_division_ranks() %>%
#' purrr::pluck("standings")
#' })
#'
#' # Restore old options
#' options(old)
Expand Down
2 changes: 2 additions & 0 deletions R/compute_draft_order.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#' old <- options(list(digits = 3, tibble.print_min = 64))
#' library(dplyr, warn.conflicts = FALSE)
#'
#' try({#to avoid CRAN test problems
#' games <-
#' nflseedR::load_sharpe_games() %>%
#' dplyr::filter(season %in% 2018:2019) %>%
Expand All @@ -24,6 +25,7 @@
#' nflseedR::compute_division_ranks() %>%
#' nflseedR::compute_conference_seeds(h2h = .$h2h, playoff_seeds = 6) %>%
#' nflseedR::compute_draft_order(games = games, h2h = .$h2h)
#' })
#'
#' # Restore old options
#' options(old)
Expand Down
2 changes: 2 additions & 0 deletions R/load_sharpe_games.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
#' @seealso The internally called function [nflreadr::load_schedules()]
#' @examples
#' \donttest{
#' try({#to avoid CRAN test problems
#' games <- load_sharpe_games()
#' dplyr::glimpse(games)
#' })
#' \dontshow{
#' # Close open connections for R CMD Check
#' future::plan("sequential")
Expand Down
4 changes: 3 additions & 1 deletion R/simulate_nfl.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
#' @returns An `nflseedR_simulation` object containing a list of 6 data frames
#' data frames with the results of all simulated games,
#' the final standings in each simulated season (incl. playoffs and draft order),
#' summary statistics across all simulated seasons, and the siumulation parameters. For a full list,
#' summary statistics across all simulated seasons, and the simulation parameters. For a full list,
#' please see [the package website](https://nflseedr.com/articles/articles/nflsim.html#simulation-output).
#' @seealso The examples [on the package website](https://nflseedr.com/articles/articles/nflsim.html)
#' @seealso The method [nflseedR::summary.nflseedR_simulation()] that creates a pretty html summary table.
Expand All @@ -99,6 +99,7 @@
#' # Parallel processing can be activated via the following line
#' # future::plan("multisession")
#'
#' try({#to avoid CRAN test problems
#' # Simulate the season 4 times in 2 rounds
#' sim <- nflseedR::simulate_nfl(
#' nfl_season = 2020,
Expand All @@ -109,6 +110,7 @@
#'
#' # Overview output
#' dplyr::glimpse(sim)
#' })
#' }
simulate_nfl <- function(nfl_season = NULL,
process_games = NULL,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pak::pak("nflverse/nflseedR")
or prebuilt from the [development repo](https://nflverse.r-universe.dev)
with:

```r
``` r
install.packages("nflseedR", repos = c("https://nflverse.r-universe.dev", getOption("repos")))
```

Expand Down
6 changes: 4 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
## Release summary

This a minor release, adding a new method and improving some functions.
This a minor release improving some functions.

## R CMD check results

0 errors | 0 warnings | 0 notes

## revdepcheck results

We checked 0 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package.
We checked 2 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package.

* We saw 0 new problems
* We failed to check 0 packages


2 changes: 2 additions & 0 deletions man/compute_conference_seeds.Rd

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

2 changes: 2 additions & 0 deletions man/compute_division_ranks.Rd

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

2 changes: 2 additions & 0 deletions man/compute_draft_order.Rd

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

2 changes: 2 additions & 0 deletions man/load_schedules.Rd

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

4 changes: 3 additions & 1 deletion man/simulate_nfl.Rd

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

0 comments on commit 51641bf

Please sign in to comment.