Skip to contents

Get per-game team statistics from barttorvik.com.

Pulls one row per team-game for a season (the getgamestats.php export): adjusted and raw offensive/defensive efficiency, the four factors on both ends, tempo, the result, pre-game win probability, and the opposing coach. No API key is required. barttorvik does not publish column headers for this file, so the column names below are mapped from its observed positional layout. Data is available from 2008 to present.

Usage

torvik_game_stats(year = most_recent_mbb_season())

Arguments

year

(integer required): Season, in 4-digit ending-year format (e.g. 2024). Defaults to most_recent_mbb_season().

Value

A hoopR_data tibble with one row per team-game. Its columns are listed in return_columns (subset(return_columns, fn == "torvik_game_stats")) and in the searchable return columns article.

Examples

# \donttest{
  # Interactive only: every team-game of a season, 4-5 s of parsing.
  try(torvik_game_stats(year = 2024))
#> ✖ 2026-11-13 21:18:04.074965: Invalid arguments or no game stats available for 2024!
#> ✖ Args: year = 2024
#> ✖ Error: lexical error: invalid char in json text.                                        <!DOCTYPE HTML PUBLIC "-//W3C//                      (right here) ------^ 
#> data frame with 0 columns and 0 rows
# }