GithubHelp home page GithubHelp logo

cricketr's Introduction

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

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

Rdoc

cricketr's People

Contributors

tvganesh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cricketr's Issues

Error Installing package

Hi Ganesh,

image

I get above error while installing package in R.

Any thought?

library(devtools)
install_github("tvganesh/cricketr")
Downloading GitHub repo tvganesh/cricketr@master
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called ‘stringi’

Thanks,
Yogs

Issue in batsmanDismissals()

First of all , I would like to appreciate your dedication in framing this package!. Hats Off!

Coming to the issues,
I have been trying to analyze Vijay Shankar's ODI dismissals. (http://stats.espncricinfo.com/ci/engine/player/477021.html?class=2;filter=advanced;orderby=start;template=results;type=batting;view=innings). and I came across 2 following issues:

(I have traced the function)

  1. batsman <- clean(file) .
    After execution of this line only one record stays in his data
    image
    image

Similarly with Rishab Pant
image
image

  1. If I manually remove the above line (batsman <- clean(file) and continue execution line by line, It looks like there is an issue that might occur with any player i.e The individual dismissal type % is calculated with denominator containing total no of innings played rather than total number of times dismissed

What I mean is that
His stats should read
Not out : 0 %
Run out : 40 %
Caught : 60 %
Refer
image

as opposed to current metrics displaying
Not out : 44%
Run out : 22%
Caught : 33%
image

Venue and Result information

Thanks for this package
I'm about to release an alpha version of a shiny dashboard based on it

Would it be possible to return venue and result data as columns in the getPlayerData() function

Error reading player data for bowling stats

library(cricketr)
library(cricketdata)
murali_id = find_player_id("Muttiah Muralitharan")$ID
murali <- getPlayerData(murali_id,dir=".",file="murali.csv",type="bowling",homeOrAway=c(1,2), result=c(1,2,4))
warne_id = find_player_id("Shane Warne")$ID
warne <- getPlayerData(warne_id,dir=".",file="warne.csv",type="bowling",homeOrAway=c(1,2), result=c(1,2,4))
kumble_id = find_player_id("Anil Kumble")$ID
kumble <- getPlayerData(kumble_id,dir=".",file="kumble.csv",type="bowling",homeOrAway=c(1,2), result=c(1,2,4))

Output:

Registered S3 method overwritten by 'quantmod':
  method            from
  as.zoo.data.frame zoo
Error in if (n[2] == "BPO") { : missing value where TRUE/FALSE needed
Calls: getPlayerData
Execution halted

Discrepancy in number of games while using getTeamData

I was using the getTeamData function, as follows:

Screenshot 2023-05-11 at 15 08 42

For ODIs played by India, I get a data-frame of 986 observations.

Screenshot 2023-05-11 at 15 10 17

However, as of 11 May 2023, India has played 1029 ODIs, according to ESPNCricinfo Statsguru. What explains this discrepancy?

Screenshot 2023-05-11 at 15 09 23

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.