getOnOffStats: Get on/off statistics from play-by-play data

View source: R/getOnOff.R

getOnOffStatsR Documentation

Get on/off statistics from play-by-play data

Description

getOnOffStats returns team statistics on offense and defense when the specified players were on the court together and when they were on the bench.

Usage

getOnOffStats(pbp, players)

Arguments

pbp

A play-by-play data frame

players

Character vector of full player names

Value

A data frame with 4 rows per game and 28 variables:

season

Starting year of the season

game_code

Game code

players

Players that were on/off the court

on

Whether players were on the court

type

Factor indicating whether the stats correspond to offense/defense

team_code

Team code.

home

Whether the team was playing at home or not

fg2a

2PA

fg2m

2PM

fg2_pct

2P%

fg3a

3PA

fg3m

3PM

fg3_pct

3P%

fga

FGA

fgm

FGM

fg_pct

FG%

fta

FTA

ftm

FTM

ft_pct

FT%

orb

ORB

drb

DRB

tov

TOV

ast

AST

stl

STL

cpf

Comitted personal fouls

blk

BLK

pts

PTS

poss

Possessions

Examples

data(samplepbp)
madrid_players <- c("FERNANDEZ, RUDY", "AYON, GUSTAVO")
getOnOffStats(pbp = samplepbp, players = madrid_players)

ponelplay/test documentation built on April 14, 2022, 12:43 a.m.