find_first_attack: Find first attacks by the receiving team (i.e. attacks...

View source: R/indicators.R

find_first_attackR Documentation

Find first attacks by the receiving team (i.e. attacks associated with a serve reception)

Description

Find first attacks by the receiving team (i.e. attacks associated with a serve reception)

Usage

find_first_attack(x)

Arguments

x

data.frame: the plays component of a datavolley object, as returned by dv_read()

Value

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

See Also

dv_read plays

Examples

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

raymondben/datavolley documentation built on May 10, 2024, 11:52 a.m.