Hey everyone, I’m Andrew Weatherman, the developer and maintainer of toRvik
. I created toRvik
to solve one distinct problem facing men’s college basketball: A lack of accessible open-source data. Synergy, CBB Analytics, and KenPom are great analytics solutions, but they are neither open source nor free. toRvik
offers speedy access to some of the most extensive and detailed college basketball data on the planet – for free and with just a few lines of code!
What to expect
toRvik
offers in-depth access to player, team, and coaching data, with most statistics back-logged to the 2007-2008 season. Granular data is available for game-by-game player statistics, offering over 40 variables per player, unprecedented access to transfer and recruiting histories, and an industry-leading game predictor model created by Bart Torvik.
Install R and RStudio
To get started, you’ll need to have R and, preferably, RStudio installed on your machine.
Head to https://cran.r-project.org
Select the appropriate link for your operating system (Windows, Mac OS X, or Linux)
Windows - Select base and download the most recent version
Mac OS X - Select Latest Release, but check to make sure your OS is the correct version. Look through Binaries for Legacy OS X Systems if you are on an older release
Linux - Select the appropriate distro and follow the installation instructions
- Head to RStudio.com
- Follow the associated download and installation instructions for RStudio.
- For Windows users: I recommend installing RTools. Many R packages will require it to successfully compile. Assuming you have downloaded the latest version of R, similarly download the latest version of RTools.
Install toRvik
The released CRAN version can be downloaded using the following:
install.packages('toRvik')
Whereas the latest development version can be downloaded using:
if (!requireNamespace('devtools', quietly = TRUE)){
install.packages('devtools')
}
devtools::install_github("andreweatherman/toRvik")
Once you have R, RStudio, and toRvik
installed, you are ready to start digging through the data!
Function structures
toRvik
offers functions that cover five major categories: Rating, player, team, game, and tournament.
Ratings
toRvik
pulls current and archived ratings from T-Rank, a well-respected leader in college basketball analytics. Historical ratings are available back to the 2014-15 season and can be aggregated by date, team, or year. Both rating functions return current and projected team records, barthag – the projected win percentage against an average team on a neutral court – and adjusted offensive and defensive efficiencies + tempo.
Rating functions:
Players
toRvik
ships with a number of functions that explore detailed player statistics. Notably, bart_player_game
provides box and advanced statistics by player for nearly 70,000 Division I games back to the 2008 season. Season-long statistics are available with bart_player_season
and bart_player_splits
. The latter will split granular player statistics by game result, type, location, or month.
Unprecedented access to transfer and recruiting histories are available with transfer_portal
and player_recruiting_rankings
. Powered by Verbal Commits, toRvik
provides the transfer histories of over 5,000 players back to the 2012 season, while individual recruiting rankings from 247Sports, ESPN, and Rivals are provided for over 6,000 players back to 2008.
Player functions:
Teams
The package exports several functions that focus on team statistics and histories. bart_team_box
returns aggregate and per-game box totals on four splits: Game result, type, location, and month. bart_team_shooting
will return team shooting performance on a number of on-court location ‘bins,’ including dunks, close two, far two, and three-point field goals. As for history, bart_team_history
returns a tidy look at per-season results and four factors.
Team functions:
Games
toRvik
pulls detailed game data with several functions. bart_game_box
returns box statistics and game information; back to the 2019 season, it will also return second chance points, points off turnovers and from the becnh, points in the paint, fast break points, and basic score data (biggest lead, biggest run, time leading, and NET quadrant).
bart_game_prediction
leverages Barttorvik’s industry-leading game predictor model to return expected possessions, points, and win percentage for any game on any date at any location back to 2015. bart_tournament_prediction
will randomly simulate single-elimination tournaments on any date.
Game functions:
Tournaments
toRvik
offers three functions that explore historical and expected tournament performance. bart_tournament_results
returns both traditional raw results and seed- and strength-adjusted performance by team, conference, NCAA seed, and coach back to 2000. bart_tourney_sheets
returns the same quality and predictive metrics that are taken into consideration by the NCAA selection committee.
Tournament functions:
Contact
If you have any suggestions or concerns, please direct message me on Twitter. My inbox is always open. If you encounter any bugs, please open a GitHub issue.
Thank you for trying out toRvik
! I hope you enjoy it.