DataVolley uses a grid to represent positions on court (values in columns "start_coordinate", "mid_coordinate", and "end_coordinate" in the play-by-play data frame). These functions convert grid index values to x, y coordinates suitable for plotting, and vice-versa. For a description of the court dimensons and coordinates see ggcourt
.
Arguments
- index
integer: vector of grid indices. If missing, the entire grid will be returned. The row numbers match the grid indices
- x
numeric: x-coordinate. For
dv_index2xy
this can be a two-column matrix or data.frame containing x and y- y
numeric: y-coordinate
Value
for dv_index2xy, a data.frame with columns "x" and "y"; for dv_xy2index a vector of integer values