Title: | Useful Functions for Cricket Analysis |
---|---|
Description: | Helping to calculate cricket specific problems in a tidy & simple manner. |
Authors: | Luke Lockley [aut, cre] |
Maintainer: | Luke Lockley <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.1.9000 |
Built: | 2025-02-28 03:46:12 UTC |
Source: | https://github.com/lukelockley/howzatr |
Convert numbers of balls as it equates in terms of six ball overs.
balls_to_overs(balls)
balls_to_overs(balls)
balls |
number of balls bowled/faced. |
number of six ball overs this equates too.
balls_to_overs(balls = 6) balls_to_overs(balls = 17)
balls_to_overs(balls = 6) balls_to_overs(balls = 17)
Calculates a batter's average over a number of innings.
bat_avg(runs_scored, no_dismissals)
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)
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)
A dataset containing basic data about batters
bat_raw_df
bat_raw_df
A data frame with 3 rows and 5 variables:
Name of Player
Numbers of Innings undertaken by Player
Numbers of Not Outs by Player
Numbers of Runs Scored by Player
Numbers of Balls Faced by Player
Calculates a batter's strike rate over a number of innings.
bat_sr(runs_scored, balls_faced)
bat_sr(runs_scored, balls_faced)
runs_scored |
A singular value of the runs scored by a batter. |
balls_faced |
A singular value of balls faced by a batter.
Overs can be converted into |
A singular value showing the batter's strike rate per 100 Balls.
A batting strike rate is the average number of runs scored per 100 balls. For example, a strike rate of 135 implies a batter would score 135 runs in a 100 balls. A higher number indicates the batter scores at faster rate. More info here.
bat_sr(runs_scored = 568, balls_faced = 600) total_runs <- sum(c(45, 123, 56, 12, 192, 34, 78, 3, 25)) total_balls <- sum(c(50, 120, 78, 3, 226, 36, 45, 12, 30)) bat_sr( runs_scored = total_runs, balls_faced = total_balls )
bat_sr(runs_scored = 568, balls_faced = 600) total_runs <- sum(c(45, 123, 56, 12, 192, 34, 78, 3, 25)) total_balls <- sum(c(50, 120, 78, 3, 226, 36, 45, 12, 30)) bat_sr( runs_scored = total_runs, balls_faced = total_balls )
Calculates bowlers' average number of runs per wicket taken across overs bowled.
bowl_avg(runs_conceded, wickets_taken)
bowl_avg(runs_conceded, wickets_taken)
runs_conceded |
total runs conceded by bowler across the overs bowled. |
wickets_taken |
total wickets taken across the overs bowled. |
Average number of runs per wicket taken across overs bowled.
A bowling average is the average number of runs conceded for wicket taken. A value of 15 indicates an average of
15 runs were conceded per wicket taken. The lower the value, the better the average; the reserve of bat_avg
More info here.
bowl_avg(runs_conceded = 50, wickets_taken = 6) bowl_avg(runs_conceded = 341, wickets_taken = 13)
bowl_avg(runs_conceded = 50, wickets_taken = 6) bowl_avg(runs_conceded = 341, wickets_taken = 13)
Calculates bowlers' economy rate over six ball overs, five ball sets or per hundred balls.
bowl_econ(balls_bowled, runs_conceded, type = "overs")
bowl_econ(balls_bowled, runs_conceded, type = "overs")
balls_bowled |
number of balls bowled. Data in terms of six ball overs,
please convert to |
runs_conceded |
total runs conceded by bowler across the overs, sets or per hundred balls bowled. |
type |
whether we are calculating economy over six ball overs, sets or per hundred balls bowled. Options "overs", "sets", "per_100". Defaults to overs |
Economy rate across the number of overs, sets or per hundred balls bowled.
Bowling economy rate is average number of runs scored per over or sets bowled.
If using overs, a value of 9.5 indicates an average of 9.5 runs are scored per six ball over bowled.
If using sets, a value of 9.5 indicates an average of 9.5 runs are scored per five ball set bowled.
If using here, a value of 9.5 indicates an average of 9.5 runs are scored per hundred balls bowled.
This the official statistic used by The Hundred.
The higher the number the more detrimental is for the bowler. Runs scored through byes & leg byes are excluded from runs conceded by the bowler,
however wides and no-balls are included in the bowler's figures.
More info here.
bowl_econ(balls_bowled = 60, runs_conceded = 45) bowl_econ( balls_bowled = overs_to_balls(overs = 7.1), runs_conceded = 26, type = "overs" ) bowl_econ(balls_bowled = 30, runs_conceded = 35, type = "sets") bowl_econ(balls_bowled = 22, runs_conceded = 19, type = "per_100")
bowl_econ(balls_bowled = 60, runs_conceded = 45) bowl_econ( balls_bowled = overs_to_balls(overs = 7.1), runs_conceded = 26, type = "overs" ) bowl_econ(balls_bowled = 30, runs_conceded = 35, type = "sets") bowl_econ(balls_bowled = 22, runs_conceded = 19, type = "per_100")
A dataset containing basic data about bowlers
bowl_raw_df
bowl_raw_df
A data frame with 3 rows and 4 variables:
Name of Player
Numbers of Balls Bowled by Player
Numbers of Runs Conceded by Player
Numbers of Wickets taken by Player
Calculates bowlers' number of balls per wicket taken across overs bowled.
bowl_sr(balls_bowled, wickets_taken)
bowl_sr(balls_bowled, wickets_taken)
balls_bowled |
number of balls bowled. Data in terms of six ball overs.
please convert to |
wickets_taken |
total wickets taken across the overs bowled. |
Number of balls per wicket taken across overs bowled.
A bowling strike rate is defined as the number of legal balls per wicket taken.
For example a value of 20 indicates 20 balls bowled are scored per wicket. This the reverse of
bat_sr
where the lower the number the better.
More info here.
bowl_sr(balls_bowled = 3830, wickets_taken = 112) bowl_sr(balls_bowled = overs_to_balls(overs = 1651.2), wickets_taken = 243)
bowl_sr(balls_bowled = 3830, wickets_taken = 112) bowl_sr(balls_bowled = overs_to_balls(overs = 1651.2), wickets_taken = 243)
Convert Overs (Six Ball) to Balls
overs_to_balls(overs)
overs_to_balls(overs)
overs |
number of six ball overs bowled/faced. |
number of six ball overs this equates too.
overs_to_balls(overs = 8.2) overs_to_balls(overs = 10)
overs_to_balls(overs = 8.2) overs_to_balls(overs = 10)