Presenting ‘Googly’, a cool Shiny app that I developed over the last couple of days. This interactive Shiny app was on my mind for quite some time, and I finally got down to implementing it. The Googly Shiny app is based on my R package ‘yorkr’ which is now available in CRAN. The R package and hence this Shiny app is based on data from Cricsheet.
Googly is based on R package yorkr, and uses the data of all IPL matches from 2008 up to 2016, available on Cricsheet.
Googly can do detailed analyses of a) Individual IPL batsman b) Individual IPL bowler c) Any IPL match d) Head to head confrontation between 2 IPL teams e) All matches of an IPL team against all other teams.
With respect to the individual IPL batsman and bowler performance, I was in a bit of a ‘bind’ literally (pun unintended), as any IPL player could have played in more than 1 IPL team. Fortunately ‘rbind’ came to my rescue. I just get all the batsman’s/bowler’s performance in each IPL team, and then consolidate it into a single large dataframe to do the analyses of.
The Shiny app can be accessed at Googly
The code for Googly is available at Github. Feel free to clone/download/fork the code from Googly
Check out my 2 books on cricket, a) Cricket analytics with cricketr b) Beaten by sheer pace – Cricket analytics with yorkr, now available in both paperback & kindle versions on Amazon!!! Pick up your copies today!
Based on the 5 detailed analysis domains there are 5 tabs
IPL Batsman: This tab can be used to perform analysis of all IPL batsman. If a batsman has played in more than 1 team, then the overall performance is considered. There are 10 functions for the IPL Batsman. They are shown below
- Batsman Runs vs. Deliveries
- Batsman’s Fours & Sixes
- Dismissals of batsman
- Batsman’s Runs vs Strike Rate
- Batsman’s Moving Average
- Batsman’s Cumulative Average Run
- Batsman’s Cumulative Strike Rate
- Batsman’s Runs against Opposition
- Batsman’s Runs at Venue
- Predict Runs of batsman
IPL Bowler: This tab can be used to analyze individual IPL bowlers. The functions handle IPL bowlers who have played in more than 1 IPL team.
- Mean Economy Rate of bowler
- Mean runs conceded by bowler
- Bowler’s Moving Average
- Bowler’s Cumulative Avg. Wickets
- Bowler’s Cumulative Avg. Economy Rate
- Bowler’s Wicket Plot
- Bowler’s Wickets against opposition
- Bowler’s Wickets at Venues
- Bowler’s wickets prediction
IPL match: This tab can be used for analyzing individual IPL matches. The available functions are
- Batting Partnerships
- Batsmen vs Bowlers
- Bowling Wicket Kind
- Bowling Wicket Runs
- Bowling Wicket Match
- Bowler vs Batsmen
- Match Worm Graph
Head to head : This tab can be used for analyzing head-to-head confrontations, between any 2 IPL teams for e.g. all matches between Chennai Super Kings vs. Deccan Chargers or Kolkata Knight Riders vs. Delhi Daredevils. The available functions are
- Team Batsmen Batting Partnerships All Matches
- Team Batsmen vs Bowlers all Matches
- Team Wickets Opposition All Matches
- Team Bowler vs Batsmen All Matches
- Team Bowlers Wicket Kind All Matches
- Team Bowler Wicket Runs All Matches
- Win Loss All Matches
Overall performance : this tab can be used analyze the overall performance of any IPL team. For this analysis all matches played by this team is considered. The available functions are
- Team Batsmen Partnerships Overall
- Team Batsmen vs Bowlers Overall
- Team Bowler vs Batsmen Overall
- Team Bowler Wicket Kind Overall
Below I include a random set of charts that are generated in each of the 5 tabs
a. Chennai Super Kings vs Deccan Chargers (2008 -05-06) – Batsmen Partnerships
Note: You can choose either team in the match from the drop down ‘Choose team’
D. Head to head confrontation
a. Rising Pune Supergiants vs Mumbai Indians in all matches – Team batsmen partnerships
For details on my R package yorkr, please see my blog Giga thoughts. There are more than 15 posts detailing the functions and their usage.
Do bowl a Googly!!!
You may like my other Shiny apps
Also see my other posts
- Introducing QCSimulator: A 5-qubit quantum computing simulator in R
- Deblurring with OpenCV: Weiner filter reloaded
- Rock N’ Roll with Bluemix, Cloudant & NodeExpress
- Introducing cricket package yorkr: Part 1- Beaten by sheer pace!
- Fun simulation of a Chain in Android
- Beaten by sheer pace! Cricket analytics with yorkr in paperback and Kindle versions
- Introducing cricketr! : An R package to analyze performances of cricketers
- Cricket analytics with cricketr!!!
For more posts see Index of posts