View source: R/standings_prettify.R
nfl_standings_prettify | R Documentation |
Uses the R package gt to create a pretty html table of NFL standings.
nfl_standings_prettify(
standings,
...,
grp_by = c("div", "conf", "nfl"),
order_by = c("div_rank", "conf_rank", "draft_rank"),
reverse = FALSE
)
standings |
A table of NFL standings. Usually computed by |
... |
Currently unused. The function errors if objects are passed to the dots, i.e. when unnamed arguments are provided. |
grp_by |
Group the output table by Division ( |
order_by |
Order teams by division rank, conference rank, or draft rank |
reverse |
Teams are sorted by the argument |
An object of class gt_tbl
.
# Calculate standings
s <- nflreadr::load_schedules(2024) |>
nflseedR::nfl_standings(ranks = "DRAFT")
# Create table
tbl1 <- nfl_standings_prettify(s, grp_by = "conf", order_by = "conf_rank")
tbl2 <- nfl_standings_prettify(s, grp_by = "nfl", order_by = "draft_rank")
# The output of tbl1 and tbl2 is given in the above images.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.