Harwell Cricket Statistics - Shiny Contest Submission

Harwell Cricket Statistics

Authors: Ben Richmond

Abstract: The perfect app for cricket nerds! Built for my club, Harwell International, to present a range of data and statistics at both, the individual player and the whole team level. Overall statistics at the club level for each year are shown for batters, bowlers and partnerships via a range of tables and interactive graphs, from the number of runs players have scored together to the equivalent distance run around a particle accelerator – very apt for a team on a science campus! Players are also able to delve into their personal statistics, looking at their performances on a match-by-match basis, as well as seeing how their season has developed over time. My club also presents novelty awards after each game, and summaries of these can be viewed via the app too. The app provides a framework for other clubs to extract the same data and present similar statistics.

Full Description: The detailed statistics viewer for the every day cricketer, utilising data from cricket matches scored online via PlayCricket, a wide range of data and visualisations are made for both individuals, and teams.
Together with overall figures for the number of runs scored and wickets taken by individuals, more in-depth statistics have been compiled, including but not limited to:

  • Bowling figures split by position of the on-strike batter, and by over of the match;
    • Which can provide insight over when the best time to utilise certain players is;
  • Chord diagram to visualise batting partnerships;
  • Cumulative individual batting/bowling statistics to see how average, strike rate etc changes across the season;
  • Wagonwheels to see where batters hit the ball, and where bowlers get hit
    • Which can aid in setting fielding positions;

If data were available for more criteria, e.g. action of the bowler to each batter, or handedness of the batter, further interesting statistics could be developed.
This app is built using R, calling on an API from PlayCricket to scrape the data from match scorecards into a sqlite database.

This database, combined with a detailed ball-by-ball output from PlayCricket Scorer Pro are called on the fly by the RShiny app, before being pushed along with a dockerfile to huggingface.co be publicly deployed.
The app is scalable and versatile such that it should be as simple as possible for any club who scores cricket matches using PlayCricket to scrape their statistics (provided they have a PlayCricket API key) into the same structure and view the app, although a few tweaks will be required, particularly to the helper files.

The full repository, available here provides the functionality for the user to produce the structured data underlying the app, before the files in the /app directory can be deployed to a separate server.


Shiny app: Harwell Cricket Statistics - a Hugging Face Space by BenRichy
Repo: GitHub - BenRichy/Harwell-Cricket-Statistics: Repository for gathering and visualising cricket statistics

Thumbnail:

Full image: