find_first_attack | R Documentation |
Find first attacks by the receiving team (i.e. attacks associated with a serve reception)
find_first_attack(x)
x |
data.frame: the plays component of a datavolley object, as returned by |
named list with components "ix" (logical indices into the x object where the row corresponds to a first attack in a rally), "n" (number of receptions for which there was a first attack by the receiving team), "n_win" (the number of winning first attacks), "win_rate" (number of winning first attacks as a proportion of the total number of first attacks).
dv_read
plays
## Not run:
x <- dv_read(dv_example_file(), insert_technical_timeouts=FALSE)
## first attack win rate, by team
by(plays(x),plays(x)$team,function(z)find_first_attack(z)$win_rate)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.