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

Description Usage Arguments Value Examples

View source: R/getOnOff.R

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

1
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

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

solmos/euroleaguer documentation built on Jan. 30, 2022, 3:16 p.m.