# cricketr v0.0.23

Monthly downloads

## Analyze Cricketers and Cricket Teams Based on ESPN Cricinfo Statsguru

Tools for analyzing performances of cricketers based on stats in
ESPN Cricinfo Statsguru. The toolset can be used for analysis of Tests,ODIs
and Twenty20 matches of both batsmen and bowlers. The package can also be used to
analyze team performances.

## Readme

# cricketr

This R package can be used to analyze performances of cricketers based on stats from ESPN Cricinfo.

The package be installed directly from CRAN as install.packages("cricketr")

or from Github as follows library(devtools) install_github("tvganesh/cricketr") library(cricketr)

Details of this package can be read from my blog Giga thoughts in Introducing cricketr: A R package for analyzing performances of cricketer

Also see my other posts in R and cricket

- A peek into literacy in India: Statistical Learning with R
- A crime map of India in R – Crimes against women
- Analyzing cricket’s batting legends – Through the mirage with R
- Masters of Spin: Unraveling the web with R
- Mirror, mirror … the best batsman of them all?
- Informed choices through Machine Learning - Analyzing Kohli, Tendulkar and Dravid
- Informed choices through Machine Learning-2: Pitting together Kumble, Kapil, Chandra

## Functions in cricketr

Name | Description | |

batsmanPerfBoxHist | Make a boxplot and a histogram of the runs scored by the batsman | |

batsmanPerfForecast | Forecast the batting performance based on past performances using Holt-Winters forecasting | |

bowlerContributionWonLost | Display the bowler's contribution in matches that were won and those that were lost | |

bowlerAvgWktsOpposition | This function computes and plot the average wickets against different oppositon | |

bowlerCumulativeAvgWickets | Bowler's cumulative average wickets | |

bowlerCumulativeAvgEconRate | Bowler's cumulative average economy rate | |

ashwin1 | Data set for Ravichander Ashwin | |

batsmanMovingAverage | Calculate and plot the Moving Average of the batsman in his career | |

batsmanMeanStrikeRate | Calculate and plot the Mean Strike Rate of the batsman on total runs scored | |

bowlerEconRate | Compute and plot the Mean Economy Rate versus wickets taken | |

bowlerHistWickets | Plot a histogram of Wicket percentages versus wickets taken | |

batsmanCumulativeStrikeRate | Batsman's cumulative average strike rate | |

bowlerPerfHomeAway | This function analyses the performance of the bowler at home and overseas | |

bowlerWktRateTT | Compute and plot the Mean number of deliveries versus wickets taken | |

batsmanPerfHomeAway | This function analyses the performance of the batsman at home and overseas | |

batsmanRunsFreqPerf | Calculate and run frequencies in ranges of 10 runs and plot versus Runs the performance of the batsman | |

getPlayerDataHA | Return the CSV file and a dataframe of a player's matches along with home/away column | |

bowlerWktsFreqPercent | Plot the Wickets Frequency as a percentage against wickets taken | |

bowlerWktsRunsPlot | Compute and plot the runs conceded versus the wickets taken | |

batsmanRunsLikelihood | This function uses K-Means to determine the likelihood of the batsman to get runs | |

batsmanRunsPredict | Predict the runs for the batsman given the Balls Faced and Minutes in crease | |

getPlayerData | Get the player data from ESPN Cricinfo based on specific inputs and store in a file in a given directory | |

batsmanContributionWonLost | Disply the batsman's contribution in matches that were won and those that were lost | |

clean | Create a batsman data frame given the batsman's CSV file | |

kohli1 | Data set for Virat Kohli | |

kumble | Data set for Anil Kumble | |

batsmanRunsRanges | Compute and plot a histogram of the runs scored in ranges of 10 | |

batsmanCumulativeAverageRuns | Batsman's cumulative average runs | |

batsmanScoringRateODTT | Compute and plot the predicted scoring rate for a One day batsman or Twenty20 | |

devilliers | Data set for AB Devilliers | |

bowlerPerfForecast | Forecast the bowler performance based on past performances using Holt-Winters forecasting | |

bowlerMovingAverage | Compute and plot the moving average of the wickets taken for a bowler | |

cleanTeamData | Clean the team data for Test, ODI and T20 | |

getTeamData | Get the data for a team in a match type viz.for Test, ODI and T20 | |

ganguly | Data set for Sourav Ganguly | |

cricketr-package | cricketr This package analyzes the performances of cricketers using ESPN Cricinfo Statsguru data. The analysis can be done for Test, ODI and Twenty20 cricket for both batsman & bowlers | |

getTeamDataHomeAway | Get the data for a team in a match type viz.for Test, ODI and T20 with the home/overseas/neutral | |

getTeamNumber | Get the number of the Team | |

cleanBowlerData | Clean the bowlers data frame | |

percentWkts | Calculate the percentage of wickets taken by bowler | |

kumble1 | Data set for Anil Kumble | |

kumblesp | Data set for Anil Kumble | |

batsmanDismissals | Display a 3D Pie Chart of the dismissals of the batsman | |

kohli | Data set for Virat Kohli | |

relativeBowlingPerf | Plot the relative performances of bowlers | |

relativeRunsFreqPerf | Calculate and compute the relative run frequencies of a list of cricketers | |

plotTimelineofWinsLosses | Plot the time line of wins/losses/draw/tied etc for a Team in Test, ODI or T20 | |

malinga | Data set for Lasith Malinga | |

tendulkarsp | Data set for Sachin Tendulkar | |

getPlayerDataSp | Get the player data along with venue and | |

getPlayerDataTT | Get the Twenty20 International player data from ESPN Cricinfo based on specific inputs and store in a file in a given directory~ | |

warne | Data set for Shane Warne | |

relativeBowlerCumulativeAvgEconRate | Relative Bowler's cumulative average economy rate | |

maxwell | Data set for Glenn Maxwell | |

malinga1 | Data set for Lasith Malinga | |

relativeBowlerCumulativeAvgWickets | Relative bowlers cumulative average wickets | |

sehwag | Data set for Virendar Sehwag | |

battingPerf3d | Make a 3D scatter plot of the Runs scored versus the Balls Faced and Minutes at Crease. | |

sehwag1 | Data set for Virendar Sehwag | |

percentRuns | Calculate the percent runs in each run range | |

narine | Data set for Sunil Narine | |

bowlerAvgWktsGround | This function computes and plot the average wickets in different ground | |

checkBatsmanInForm | Check whether the batsman is In-Form or Out-Of-Form by looking at his last 10 percent scores | |

mendis | Data set for Ajantha Mendis | |

relativeBowlingERODTT | Compute and plot the relative mean Economy Rate(ER) of the bowlers for ODI or Twenty20 | |

relativeBowlingER | Compute and plot the relative mean Economy Rate(ER) of the bowlers | |

teamWinLossStatusAtGrounds | Compute the wins/losses/draw/tied etc for a Team in Test, ODI or T20 at venues | |

relativeBatsmanSR | Calculate and plot the relative Mean Strike Rate (SR) for each batsman | |

steyn | Data set for Dale Steyn | |

checkBowlerInForm | Check whether the bowler is In-Form or Out-Of-Form by looking at his last 10 percent scores | |

relativeBatsmanSRODTT | Calculate and plot the relative Mean Strike Rate (SR) for each batsman for ODI or Twenty20 batsmen | |

gayle | Data set for Chris Gayle | |

tendulkar1 | Data set for Sachin Tendulkar | |

relativeRunsFreqPerfODTT | Calculate and compute the relative run frequencies of a list of cricketers | |

tendulkar2 | Data set for Sachin Tendulkar | |

relativeWktRateTT | Compute and plot the relative Mean Wicket Rate of the bowlers in Twenty20 International | |

getMatchType | Get the number of the match type viz.for Test, ODI and T20 | |

getPlayerDataOppnHA | Return a filtered CSV file for a player against specified opposition, at home/away venues during an interval | |

relativeBatsmanCumulativeAvgRuns | Relative batsman's cumulative average runs | |

getPlayerDataOD | Get the One day player data from ESPN Cricinfo based on specific inputs and store in a file in a given directory | |

murali | Data set for Muthiah Muralitharan | |

relativeBatsmanCumulativeStrikeRate | Relative batsmen cumulative average strike rate | |

mitchell | Data set for Mitchell Johnson | |

teamWinLossStatusVsOpposition | Compute the wins/losses/draw/tied etc for a Team in Test, ODI or T20 against opposition | |

sehwag2 | Data set for Virendar Sehwag | |

tendulkar | Data set for Sachin Tendulkar | |

southee | Data set for Tim Southee | |

batsman6s | Plot the run range against the number of 6s | |

batsman4s | Plot the numbers of 4s against the runs scored by batsman | |

ER | Calculate the mean Economy Rate | |

batsman4s6s | Compute and plot a stacked barplot of runs,4s and 6s | |

WR | This function caculates the wicket rate vs mean number of deliveries | |

batsmanAvgRunsGround | This function computes and plots the Average runs scored in the different grounds played by batsman | |

batsmanAvgRunsOpposition | This function computes and plots the Average runs against different opposition played by batsman | |

ashwin | Data set for Ravichandran Ashwin | |

badree | Data set for Samuel Badree | |

No Results! |

## Last month downloads

## Details

Type | Package |

Date | 2020-03-28 |

License | MIT + file LICENSE |

URL | https://github.com/tvganesh/cricketr |

BugReports | https://github.com/tvganesh/cricketr/issues |

RoxygenNote | 5.0.1 |

NeedsCompilation | no |

Packaged | 2020-03-28 14:06:38 UTC; Ganesh |

Repository | CRAN |

Date/Publication | 2020-03-28 14:30:02 UTC |

imports | dplyr , forecast , ggplot2 , graphics , grDevices , httr , lubridate , plotrix , scatterplot3d , stats , utils , XML |

depends | R (>= 3.1.2) |

Contributors | Tinniam Ganesh |

#### Include our badge in your README

```
[![Rdoc](http://www.rdocumentation.org/badges/version/cricketr)](http://www.rdocumentation.org/packages/cricketr)
```