dv_index2xy | R Documentation |
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
.
dv_index2xy(index)
dv_xy2index(x, y)
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 |
y |
numeric: y-coordinate |
for dv_index2xy, a data.frame with columns "x" and "y"; for dv_xy2index a vector of integer values
ggcourt
, dv_xy
, dv_flip_xy
, dv_xy2zone
, dv_xy2subzone
## positions (zones) 1 and 3 are at x, y coordinates c(3, 1) and c(2, 3) respectively
## their grid indices:
dv_xy2index(c(3, 2), c(1, 3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.