View source: R/batting_basics.R

bat_avg | R Documentation |

Calculates a batter's average over a number of innings.

bat_avg(runs_scored, no_dismissals)

`runs_scored` |
A singular value of the runs scored by a batter. |

`no_dismissals` |
A singular value of the number of times a batters has been dismissed within those innings. |

A singular value showing the batter's average.

A batting average is the number of runs divided by the number of times a batters is dismissed.
Batters who remain **not out** at the end of an innings **don't** have that innings
count towards the number of dismissals. The higher average typically indicates a higher quality player.
More info here.

bat_avg(runs_scored = 568, no_dismissals = 9) total_runs <- sum(c(45, 123, 56, 12, 192, 34, 78, 3, 25)) bat_avg(runs_scored = total_runs, no_dismissals = 9)

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.