torvik

Extensive and Tidy NCAA Men's College Basketball Data

https://github.com/andreweatherman/torvik

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (17.0%) to scientific vocabulary

Keywords

basketball basketball-stats college-basketball r
Last synced: 10 months ago · JSON representation

Repository

Extensive and Tidy NCAA Men's College Basketball Data

Basic Info
  • Host: GitHub
  • Owner: andreweatherman
  • License: other
  • Language: HTML
  • Default Branch: main
  • Homepage: https://www.torvik.dev/
  • Size: 1.41 MB
Statistics
  • Stars: 19
  • Watchers: 1
  • Forks: 4
  • Open Issues: 2
  • Releases: 2
Archived
Topics
basketball basketball-stats college-basketball r
Created about 4 years ago · Last pushed over 2 years ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: github_document
---



# toRvik 



[![CRAN status](https://www.r-pkg.org/badges/version/toRvik)](https://CRAN.R-project.org/package=toRvik) [![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable) [![R-CMD-check](https://github.com/andreweatherman/toRvik/workflows/R-CMD-check/badge.svg)](https://github.com/andreweatherman/toRvik/actions) [![Codecov test coverage](https://codecov.io/gh/andreweatherman/toRvik/branch/main/graph/badge.svg)](https://app.codecov.io/gh/andreweatherman/toRvik?branch=main)



[**`toRvik`**](https://github.com/andreweatherman/toRvik) is an R package for working with and scraping men's college basketball.

There are a lot of college basketball data out there, but most are difficult to pull and clean or they are behind a paywall. With `toRvik`, you have immediate access to some of the most detailed and extensive college basketball statistics publicly available -- all returned in tidy format with just a single line of code! Best of all, no subscription is required to access the data.\
\
Most of `toRvik`'s functions are powered by a dedicated Fast API framework -- delivering data at rapid speeds with dependable up-times.

As of version 1.0.3, the package includes nearly 30 functions for pulling player and team data, game results, advanced metric splits, play-by-play shooting, and more. Leveraging the same data and models as [Barttorvik](https://www.barttorvik.com), the package now offers game and tournament predictor functions, allowing you to simulate games between any pair of teams on any date at any venue back to the 2014-15 season. `toRvik` also offers extensive transfer histories for over 5,000 players back to the 2011-12 season and detailed player recruiting rankings for over 6,000 players back to 2007-08.

## Package Installation

```{r, include=FALSE}
library(dplyr)
library(toRvik)
```


Install the released version of `toRvik` from CRAN:

```{r, eval=FALSE}
install.packages("toRvik")
```

Or install the development version from GitHub with:

```{r, eval=FALSE}
if (!requireNamespace('devtools', quietly = TRUE)){
  install.packages('devtools')
}
devtools::install_github("andreweatherman/toRvik") 
```

## Package Highlights

-   Detailed game-by-game + season-long statistics by player and split
-   Extensive transfer + recruiting histories
-   Custom game and tournament predictions
-   Shooting splits + shares by team
-   Game box scores for all D-1 games
-   Team + conference four factors by split
-   Game-by-game four factors
-   NCAA committee-style team sheets
-   D-1 head coaching changes

## Basic Uses

All `toRvik` functions fall into one of six categories:

-   **Rating**, pulling and slicing T-Rank + four factor data
-   **Player**, pulling player data and histories
-   **Team**, pulling team statistics and histories
-   **Game**, pulling game-by-game data and schedules
-   **Tournament**, pulling raw and adjusted tournament performance
-   **Miscellaneous**

### Pull T-Rank ratings:

Calling `bart_ratings` will return the current T-Rank ranks and ratings.

```{r}
head(bart_ratings())
```

### Pull team statistics

Calling `bart_factors` will return four factor stats on a number of splits. To filter by home games, set venue to 'home.'

```{r}
head(bart_factors(location='H'))
```

Calling `bart_team_box` will return team box totals and per-game averages by game type. To find how Duke performed during the month of March:

```{r}
bart_team_box(team='Duke', split='month') |>
  dplyr::filter(month=='March')
```

### Pull player statistics

Calling `bart_player_season` will return detailed season-long player stats. To pull per-game averages for Duke players:

```{r}
head(bart_player_season(team='Duke', stat='box'))
```

Calling `bart_player_game` will return detailed game-by-game player stats. To pull advance splits by game for Duke players:

```{r}
head(bart_player_game(team='Duke', stat='advanced'))
```

### Pull transfer histories

Calling `transfer_portal` will return transfer histories with matching player IDs to join with other statistics. To find all players who transferred to Duke:

```{r}
head(transfer_portal(to='Duke'))
```

### Pull recruiting rankings

Calling `player_recruiting_rankings` will return extensive recruit histories with matching player IDs. To find all 5-star players who played high school basketball in North Carolina:

```{r}
head(player_recruiting_rankings(stars=5, state='NC'))
```

### Predict games and tournaments

Calling `bart_game_predictions` will returns expected points, possessions, and win percentage for a given game on a given date. To simulate North Carolina at Duke in mid-January:

```{r}
bart_game_prediction('Duke', 'North Carolina', '20220113', location = 'H')
```

Calling `bart_tournament_prediction` will simulate a single-elimination tournament between a group of teams on a given date. To simulate the 2022 Final Four 25 times:

```{r}
bart_tournament_prediction(teams = c('Duke', 'North Carolina', 'Kansas', 'Villanova'), '20220402', sims = 25, seed = 10)
```

## Documentation

For more information on the package and its functions, please see the [**`toRvik`** reference](https://www.torvik.dev/).

## The Author

[Andrew Weatherman](https://www.linkedin.com/in/andrewweatherman/)

@andreweatherman

Owner

  • Name: Andrew Weatherman
  • Login: andreweatherman
  • Kind: user
  • Location: Durham, North Carolina

Duke '23 | Duke Men's Basketball student manager

GitHub Events

Total
  • Watch event: 2
Last Year
  • Watch event: 2

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 20
  • Total pull requests: 1
  • Average time to close issues: 16 days
  • Average time to close pull requests: 1 day
  • Total issue authors: 7
  • Total pull request authors: 1
  • Average comments per issue: 0.95
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: 1 day
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • andreweatherman (13)
  • sportfoliokings (2)
  • mattrhein (1)
  • JayTheriault (1)
  • rlaird1 (1)
  • colinkrantz7 (1)
  • bmargio (1)
Pull Request Authors
  • olivroy (2)
Top Labels
Issue Labels
bug (6) enhancement (4) documentation (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total docker downloads: 21,613
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 3
  • Total maintainers: 1
cran.r-project.org: toRvik

Extensive and Tidy NCAA Men's College Basketball Data

  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Docker Downloads: 21,613
Rankings
Dependent repos count: 25.5%
Average: 27.6%
Dependent packages count: 29.8%
Maintainers (1)
Last synced: 11 months ago

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/check-r-package v1 composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
  • r-lib/actions/setup-r-dependencies v1 composite
.github/workflows/pkgdown.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
  • r-lib/actions/setup-r-dependencies v1 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION cran
  • R >= 2.10 depends
  • arrow * imports
  • cli * imports
  • crayon * imports
  • curl * imports
  • data.table * imports
  • dplyr * imports
  • glue * imports
  • httr * imports
  • janitor * imports
  • jsonlite * imports
  • lubridate * imports
  • magrittr * imports
  • purrr * imports
  • readr * imports
  • rlang * imports
  • rvest * imports
  • stringr * imports
  • tidyr * imports
  • withr * imports
  • DBI * suggests
  • covr * suggests
  • knitr * suggests
  • rmarkdown * suggests
  • spelling * suggests
  • testthat >= 3.0.0 suggests
  • tictoc * suggests