plot.assistnet: Plots a network from a 'assistnet' object

View source: R/plot.assistnet.R

plot.assistnetR 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 assistnet.

layout

character, network vertex layout algorithm (see gplot.layout) such as "kamadakawai" (the default).

layout.par

a list of parameters for the network vertex layout algorithm (see gplot.layout).

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 nodeStats data frame in the x object, see assistnet).

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 nodeStats data frame in the x object, see assistnet).

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

assistnet

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

sndmrc/BasketAnalyzeR documentation built on June 6, 2023, 12:52 a.m.