assistnet: Investigates the network of assists-shots in a team

View source: R/assistnet.R

assistnetR Documentation

Investigates the network of assists-shots in a team

Description

The assistnet command provides a comprehensive analysis of a team's assist-shot network, revealing crucial insights into player interactions and on-court dynamics. \loadmathjax

Usage

assistnet(
  data,
  assist = "assist",
  player = "player",
  points = "points",
  event.type = "event_type",
  normalize = FALSE,
  period.length = 12,
  time.thr = 0
)

Arguments

data

a data frame whose rows are field shots and columns are variables to be specified in assist, player, points, event.type (see Details).

assist

character, indicating the name of the variable with players who made the assists, if any.

player

character, indicating the name of the variable with players who made the shot.

points

character, indicating the name of the variable with points.

event.type

character, indicating the name of the variable with type of event (mandatory categories are "miss" for missed field shots and "shot" for field goals).

normalize

logical, if TRUE the number of assists is normalized (default normalize=FALSE, see Details).

period.length

numerical, the length of a quarter in minutes (default: 12 minutes as in NBA)

time.thr

numerical, Minimum number of minutes played together by a pair of players required for computing their normalized assist count. Pairs below time.thr are excluded to avoid inflation due to small denominators (default: time.thr = 0).

Details

The data data frame could also be a play-by-play dataset provided that rows corresponding to events different from field shots are not coded as "shot" in the event.type variable. (To be completed)

Normalization: \mjdeqn4 \cdot \text(period.length) \cdot \frac(\textnumber of assists)\text(minutes played in attack by each couple of players)4 (period.length) (number of assists)/(minutes played in attack by each couple of players)

Value

A list with 3 elements, assistTable (a table), nodeStats (a data frame), and assistNet (a network object). See Details.

assistTable, the cross-table of assists made and received by the players.

nodeStats, a data frame with the following variables:

  • FGM (fields goals made),

  • FGM_AST (field goals made thanks to a teammate's assist),

  • FGM_ASTp (percentage of FGM_AST over FGM),

  • FGPTS (points scored with field goals),

  • FGPTS_AST (points scored thanks to a teammate's assist),

  • FGPTS_ASTp (percentage of FGPTS_AST over FGPTS),

  • AST (assists made),

  • ASTPTS (point scored by assist's teammates).

minTable, a square matrix with the total number of minutes played in attack by each pair of players; the elements on the principal diagonal are set to zero.

assistminTable, a matrix showing the assist frequency between player pairs, adjusted for minutes played together in attack and expressed per 4*period.length minutes.

assistNet, an object of class network that can be used for further network analysis with specific R packages (see network)

Author(s)

Marco Sandri, Paola Zuccolotto, Marica Manisera (basketballanalyzer.help@unibs.it)

References

P. Zuccolotto and M. Manisera (2020) Basketball Data Science: With Applications in R. CRC Press.

P. Zuccolotto, M. Manisera and M. Sandri (2026) Advanced Basketball Data Science: With Applications in R. CRC Press.

Examples

PbP <- PbPmanipulation(PbP.BDB)
PbP.GSW <- subset(PbP, team=="GSW")
out <- assistnet(PbP.GSW)
plot(out)
## Not run: 
  out <- assistnet(PbP.GSW, normalize=TRUE, time.thr=50)
  plot(out, edge.thr=5)

## End(Not run)

BasketballAnalyzeR documentation built on June 8, 2025, 10:12 a.m.