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

Description Usage Arguments Details Value Author(s) References Examples

View source: R/assistnet.R

Description

Investigates the network of assists-shots in a team

Usage

1
2
3
4
5
6
7
assistnet(
  data,
  assist = "assist",
  player = "player",
  points = "points",
  event.type = "event_type"
)

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).

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.

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:

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.

Examples

1
2
3
4
PbP <- PbPmanipulation(PbP.BDB)
PbP.GSW <- subset(PbP, team=="GSW")
out <- assistnet(PbP.GSW)
plot(out, layout="circle", edge.thr=30, node.col="FGM_ASTp", node.size="ASTPTS")

BasketballAnalyzeR documentation built on July 2, 2020, 2:14 a.m.