get_clutch: Download clutch data for Players and Teams

Description Usage Arguments Value Author(s) Examples

View source: R/get_clutch.R

Description

Download and process NBA.com defense data from http://stats.nba.com/players/defense-dash-overall/, http://stats.nba.com/teams/defense-dash-overall/ etc.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
get_clutch(
  season,
  ahead_behind,
  clutch_time,
  measure_type = "Base",
  date_from = "",
  date_to = "",
  per_mode = "PerGame",
  season_type = "Regular+Season",
  verbose = TRUE
)

Arguments

season

Number of the year in which season started

ahead_behind

Specify clutch situation c('Ahead+or+Behind','Behind+or+Tied','Ahead+or+Tied')

clutch_time

Specify clutch time c('Last+5+Minutes','Last+4+Minutes','Last+3+Minutes','Last+2+Minutes','Last+1+Minute','Last+30+Seconds','Last+10+Seconds')

measure_type

Specify metrics type c('Base','Advanced','Misc','Scoring','Usage')

date_from

Day from which data will be collected. It is set in MM/DD/YYYY format and by default is not specified, so data is calculated for whole season.

date_to

Day to which data will be collected. It is set in MM/DD/YYYY format and by default is not specified, so data is calculated for whole season.

per_mode

Specify if you want data divided per game or totals. Default parameter is "PerGame". c("PerGame","Totals")

season_type

Choose data for preseason, regular season or postseason. Default parameter is "Regular Season". c("Regular Season","Playoffs","Pre Season","All Star")

verbose

Defalt TRUE - prints additional information

Value

Dataset from stats.nba.com

Author(s)

Patrick Chodowski, Chodowski.Patrick@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
season <- 2019
ahead_behind = c('Ahead+or+Behind','Behind+or+Tied','Ahead+or+Tied')[1]
clutch_time = c('Last+5+Minutes','Last+4+Minutes','Last+3+Minutes',
'Last+2+Minutes','Last+1+Minute','Last+30+Seconds','Last+10+Seconds')[1]
measure_type = c('Base','Advanced','Misc','Scoring','Usage')[1]
per_game = c('PerGame','Totals')[1]

season_type <- c("Regular+Season","Playoffs","Pre+Season","All+Star")[1]
date_from <- "2020-01-01"
date_to <- "2020-03-01"
season <- 2019

clutch.dataset <- get_clutch(2019,'Ahead+or+Behind','Last+5+Minutes')

PatrickChodowski/NBAr documentation built on April 20, 2021, 10:21 p.m.