Skip to content

Commit

Permalink
add torvik_team_schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Weatherman authored and Andrew Weatherman committed Feb 18, 2024
1 parent c08623a commit 9a3e4d8
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export(cbd_torvik_season_simulation)
export(cbd_torvik_similar_resumes)
export(cbd_torvik_team_factors)
export(cbd_torvik_team_history)
export(cbd_torvik_team_schedule)
export(cbd_torvik_team_split)
import(dplyr)
import(httr)
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- Added [`cbd_all_metrics`](https://cbbdata.aweatherman.com/reference/cbd_all_metrics.html) to source Torvik, KenPom, BPI, SOR/SOS, and NET in one unified tibble.
- Added [`cbd_match_teams`](https://cbbdata.aweatherman.com/reference/cbd_match_teams.html) to build a team-matching named vector.
- KenPom authorization is no longer needed for [`cbd_kenpom_ratings`] (these ratings are public).
- Added [`cbd_torvik_team_schedule`](https://cbbdata.aweatherman.com/reference/cbd_torvik_team_schedule.html) to query team schedules

# cbbdata 0.2.0

Expand Down
20 changes: 20 additions & 0 deletions R/cbd_torvik_team_schedule.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#' Barttorvik Team Season Schedules
#'
#' Pulls season schedules from Barttorvik
#'
#' @param ... OPTIONAL. To load the complete data set, pass no arguments through
#' to the function.
#'
#' @examples
#' \donttest{try(cbd_torvik_team_schedule(team = 'Duke', year = 2023))}
#'
#' @export
cbd_torvik_team_schedule <- function(...) {

base_url <- 'https://www.cbbdata.com/api/torvik/team_schedules?'

data <- cbbdata:::get_cbd_file(base_url, ...)

return(data)

}
1 change: 1 addition & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ reference:
- cbd_torvik_game_factors
- cbd_torvik_game_stats
- cbd_torvik_season_schedule
- cbd_torvik_team_schedule
- cbd_add_net_quad
- title: Predictions
desc: Functions for running T-Rank predictions and Monte Carlo simulations
Expand Down
19 changes: 19 additions & 0 deletions man/cbd_torvik_team_schedule.Rd

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

0 comments on commit 9a3e4d8

Please sign in to comment.