plot.assistnet {BasketballAnalyzeR} | R Documentation |
Plots a network from a 'assistnet' object
Description
Plots a network from a 'assistnet' object
Usage
## S3 method for class 'assistnet'
plot(
x,
layout = "kamadakawai",
layout.par = list(),
edge.thr = 0,
edge.col.lim = NULL,
edge.col.lab = NULL,
node.size = NULL,
node.size.lab = NULL,
node.col = NULL,
node.col.lim = NULL,
node.col.lab = NULL,
node.pal = colorRampPalette(c("white", "blue", "red")),
edge.pal = colorRampPalette(c("white", "blue", "red")),
...
)
Arguments
x |
an object of class |
layout |
character, network vertex layout algorithm (see |
layout.par |
a list of parameters for the network vertex layout algorithm (see |
edge.thr |
numeric, threshold for edge values; values below the threshold are set to 0. |
edge.col.lim |
numeric vector of length two providing limits of the scale for edge color. |
edge.col.lab |
character, label for edge color legend. |
node.size |
character, indicating the name of the variable for node size (one of the columns of the |
node.size.lab |
character, label for node size legend. |
node.col |
character, indicating the name of the variable for node color (one of the columns of the |
node.col.lim |
numeric vector of length two providing limits of the scale for node color. |
node.col.lab |
character, label for node color legend. |
node.pal |
color palette for node colors. |
edge.pal |
color palette for edge colors. |
... |
other graphical parameters. |
Value
A ggplot2
object
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.
See Also
Examples
PbP <- PbPmanipulation(PbP.BDB)
PbP.GSW <- subset(PbP, team=="GSW" & player!="")
out <- assistnet(PbP.GSW)
plot(out, layout="circle", edge.thr=30, node.col="FGM_ASTp", node.size="ASTPTS")