rnrs_btn: Runners Beaten

Description Usage Arguments Details Examples

Description

Calculates the percentage of runners beaten.

Usage

1
rnrs_btn(pos)

Arguments

pos

finishing position

Details

It is best used with the power of the dplyr package, to calculate the percentage of runners beaten across numerous races in the same dataframe (see examples)

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
# dataframe consisting of position (pos) variable and starting gate (gate)
# find percentage of runners beaten per starting gate
races %>%
     mutate(pct_btn = rnrs_btn(pos)) %>%
     group_by(gate) %>%
     summarise(pct_btn = mean(pct_btn))

## End(Not run)

durtal/RcappeR documentation built on May 15, 2019, 6 p.m.