Title: | Analyze Cricketers and Cricket Teams Based on ESPN Cricinfo Statsguru |
---|---|
Description: | 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. |
Authors: | Tinniam V Ganesh |
Maintainer: | Tinniam V Ganesh <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.26 |
Built: | 2025-02-26 03:29:54 UTC |
Source: | https://github.com/tvganesh/cricketr |
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. 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
The DESCRIPTION file:
Package: | cricketr |
Type: | Package |
Title: | Analyze Cricketers and Cricket Teams Based on ESPN Cricinfo Statsguru |
Description: | 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. |
Version: | 0.0.26 |
Date: | 2021-03-22 |
Author: | Tinniam V Ganesh |
Maintainer: | Tinniam V Ganesh <[email protected]> |
License: | MIT + file LICENSE |
Depends: | R (>= 3.1.2) |
Imports: | dplyr, plotrix, ggplot2, scatterplot3d, forecast, lubridate, XML, graphics, grDevices, httr, stats, utils |
URL: | https://github.com/tvganesh/cricketr |
BugReports: | https://github.com/tvganesh/cricketr/issues |
RoxygenNote: | 7.1.1 |
Config/pak/sysreqs: | libxml2-dev libssl-dev |
Repository: | https://tvganesh.r-universe.dev |
RemoteUrl: | https://github.com/tvganesh/cricketr |
RemoteRef: | HEAD |
RemoteSha: | bc40c9a0c26425f07e45f66e73d6bb83b4bf34c3 |
Index of help topics:
ER Calculate the mean Economy Rate WR This function caculates the wicket rate vs mean number of deliveries ashwin Data set for Ravichandran Ashwin ashwin1 Data set for Ravichander Ashwin badree Data set for Samuel Badree batsman4s Plot the numbers of 4s against the runs scored by batsman batsman4s6s Compute and plot a stacked barplot of runs,4s and 6s batsman6s Plot the run range against the number of 6s 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 batsmanContributionWonLost Disply the batsman's contribution in matches that were won and those that were lost batsmanCumulativeAverageRuns Batsman's cumulative average runs batsmanCumulativeStrikeRate Batsman's cumulative average strike rate batsmanDismissals Display a 3D Pie Chart of the dismissals of the batsman batsmanMeanStrikeRate Calculate and plot the Mean Strike Rate of the batsman on total runs scored batsmanMovingAverage Calculate and plot the Moving Average of the batsman in his career 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 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 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 batsmanRunsRanges Compute and plot a histogram of the runs scored in ranges of 10 batsmanScoringRateODTT Compute and plot the predicted scoring rate for a One day batsman or Twenty20 battingPerf3d Make a 3D scatter plot of the Runs scored versus the Balls Faced and Minutes at Crease. bowlerAvgWktsGround This function computes and plot the average wickets in different ground bowlerAvgWktsOpposition This function computes and plot the average wickets against different oppositon bowlerContributionWonLost Display the bowler's contribution in matches that were won and those that were lost bowlerCumulativeAvgEconRate Bowler's cumulative average economy rate bowlerCumulativeAvgWickets Bowler's cumulative average wickets bowlerEconRate Compute and plot the Mean Economy Rate versus wickets taken bowlerHistWickets Plot a histogram of Wicket percentages versus wickets taken bowlerMovingAverage Compute and plot the moving average of the wickets taken for a bowler bowlerPerfForecast Forecast the bowler performance based on past performances using Holt-Winters forecasting 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 bowlerWktsFreqPercent Plot the Wickets Frequency as a percentage against wickets taken bowlerWktsRunsPlot Compute and plot the runs conceded versus the wickets taken checkBatsmanInForm Check whether the batsman is In-Form or Out-Of-Form by looking at his last 10 percent scores checkBowlerInForm Check whether the bowler is In-Form or Out-Of-Form by looking at his last 10 percent scores clean Create a batsman data frame given the batsman's CSV file cleanBowlerData Clean the bowlers data frame cleanTeamData Clean the team data for Test, ODI and T20 cricketr-package Analyze Cricketers and Cricket Teams Based on ESPN Cricinfo Statsguru 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 devilliers Data set for AB Devilliers ganguly Data set for Sourav Ganguly gayle Data set for Chris Gayle getMatchType Get the number of the match type viz.for Test, ODI and T20 getPlayerData Get the player data from ESPN Cricinfo based on specific inputs and store in a file in a given directory getPlayerDataHA Return the CSV file and a dataframe of a player's matches along with home/away column getPlayerDataOD Get the One day player data from ESPN Cricinfo based on specific inputs and store in a file in a given directory getPlayerDataOppnHA Return a filtered CSV file for a player against specified opposition, at home/away venues during an interval 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~ getTeamData Get the data for a team in a match type viz.for Test, ODI and T20 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 kohli Data set for Virat Kohli kohli1 Data set for Virat Kohli kumble Data set for Anil Kumble kumble1 Data set for Anil Kumble kumblesp Data set for Anil Kumble malinga Data set for Lasith Malinga malinga1 Data set for Lasith Malinga maxwell Data set for Glenn Maxwell mendis Data set for Ajantha Mendis mitchell Data set for Mitchell Johnson murali Data set for Muthiah Muralitharan narine Data set for Sunil Narine percentRuns Calculate the percent runs in each run range percentWkts Calculate the percentage of wickets taken by bowler plotTimelineofWinsLosses Plot the time line of wins/losses/draw/tied etc for a Team in Test, ODI or T20 relativeBatsmanCumulativeAvgRuns Relative batsman's cumulative average runs relativeBatsmanCumulativeStrikeRate Relative batsmen cumulative average strike rate relativeBatsmanSR Calculate and plot the relative Mean Strike Rate (SR) for each batsman relativeBatsmanSRODTT Calculate and plot the relative Mean Strike Rate (SR) for each batsman for ODI or Twenty20 batsmen relativeBowlerCumulativeAvgEconRate Relative Bowler's cumulative average economy rate relativeBowlerCumulativeAvgWickets Relative bowlers cumulative average wickets relativeBowlingER Compute and plot the relative mean Economy Rate(ER) of the bowlers relativeBowlingERODTT Compute and plot the relative mean Economy Rate(ER) of the bowlers for ODI or Twenty20 relativeBowlingPerf Plot the relative performances of bowlers relativeRunsFreqPerf Calculate and compute the relative run frequencies of a list of cricketers relativeRunsFreqPerfODTT Calculate and compute the relative run frequencies of a list of cricketers relativeWktRateTT Compute and plot the relative Mean Wicket Rate of the bowlers in Twenty20 International sehwag Data set for Virendar Sehwag sehwag1 Data set for Virendar Sehwag sehwag2 Data set for Virendar Sehwag southee Data set for Tim Southee steyn Data set for Dale Steyn teamWinLossStatusAtGrounds Compute the wins/losses/draw/tied etc for a Team in Test, ODI or T20 at venues teamWinLossStatusVsOpposition Compute the wins/losses/draw/tied etc for a Team in Test, ODI or T20 against opposition tendulkar Data set for Sachin Tendulkar tendulkar1 Data set for Sachin Tendulkar tendulkar2 Data set for Sachin Tendulkar tendulkarsp Data set for Sachin Tendulkar warne Data set for Shane Warne
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.
Tinniam V Ganesh Tinniam V Ganesh Maintainer: Tinniam V Ganesh <[email protected]> Tinniam V Ganesh [email protected]
Details in my post https://gigadom.in/2015/07/04/introducing-cricketr-a-r-package-to-analyze-performances-of-cricketers/
https://www.youtube.com/edit?o=U&video_id=q9uMPFVsXsI
## Not run: getPlayerData(profile,opposition="",host="",dir="./data",file="player001.csv", type="batting", homeOrAway=c(1,2),result=c(1,2,4)) getPlayerDataOD(profile, opposition="",host="",dir = "../", file = "player001.csv", type = "batting", homeOrAway = c(1, 2, 3), result = c(1, 2, 3,5)) getPlayerDataTT(profile, opposition="",host="",dir = "./data", file = "player001.csv", type = "batting", homeOrAway = c(1, 2, 3), result = c(1, 2, 3,5)) batsmanAvgRunsGround(file, name = "A Latecut") bowlerAvgWktsGround(file, name = "A Chinaman") tendulkar <- system.file("data", "tendulkar.csv", package = "cricketr") ganguly <- system.file("data", "ganguly.csv", package = "cricketr") dravid <- system.file("data", "dravid.csv", package = "cricketr") batsmen <- list(tendulkar,dravid,ganguly) names <- list("Tendulkar","Dravid","Ganguly") relativeBatsmanCumulativeAvgRuns(batsmen,names) ## End(Not run)
## Not run: getPlayerData(profile,opposition="",host="",dir="./data",file="player001.csv", type="batting", homeOrAway=c(1,2),result=c(1,2,4)) getPlayerDataOD(profile, opposition="",host="",dir = "../", file = "player001.csv", type = "batting", homeOrAway = c(1, 2, 3), result = c(1, 2, 3,5)) getPlayerDataTT(profile, opposition="",host="",dir = "./data", file = "player001.csv", type = "batting", homeOrAway = c(1, 2, 3), result = c(1, 2, 3,5)) batsmanAvgRunsGround(file, name = "A Latecut") bowlerAvgWktsGround(file, name = "A Chinaman") tendulkar <- system.file("data", "tendulkar.csv", package = "cricketr") ganguly <- system.file("data", "ganguly.csv", package = "cricketr") dravid <- system.file("data", "dravid.csv", package = "cricketr") batsmen <- list(tendulkar,dravid,ganguly) names <- list("Tendulkar","Dravid","Ganguly") relativeBatsmanCumulativeAvgRuns(batsmen,names) ## End(Not run)
CSV file Ravichandran Ashwin
data("ashwin")
data("ashwin")
The format is: chr "ashwin"
CSV file Ravichandran Ashwin
https://www.espncricinfo.com/ci/content/stats/index.html
https://www.espncricinfo.com/ci/content/stats/index.html
Data set for Ravichander Ashwin
data("ashwin1")
data("ashwin1")
The format is: chr "ashwin1"
Data set for Ravichander Ashwin
https://www.espncricinfo.com/ci/content/stats/index.html
https://www.espncricinfo.com/ci/content/stats/index.html
CSV file Samuel Badree
data("badree")
data("badree")
The format is: chr "badree"
CSV file Samuel Badree
ESPN Cricinfo Statsguru
https://www.espncricinfo.com/ci/content/stats/index.html
This function plots the number of 4s against the total runs scored by batsman. A 2nd order polynomial regression curve is also plotted. The predicted number of 4s for 50 runs and 100 runs scored is also plotted
batsman4s(file, name="A Hookshot")
batsman4s(file, name="A Hookshot")
file |
This is the <batsman>.csv file obtained with an initial getPlayerData() |
name |
Name of the batsman |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() #tendulkar <- getPlayerData(35320,dir="../",file="tendulkar.csv",type="batting", #homeOrAway=c(1,2),result=c(1,2,4)) # retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsman4s(pathToFile, "Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. The # general format is pkg-function(pathToFile,par1,...) ## End(Not run)
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() #tendulkar <- getPlayerData(35320,dir="../",file="tendulkar.csv",type="batting", #homeOrAway=c(1,2),result=c(1,2,4)) # retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsman4s(pathToFile, "Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. The # general format is pkg-function(pathToFile,par1,...) ## End(Not run)
Compute and plot a stacked barplot of percentages of runs in (1s,2s and 3s),4s and 6s
batsman4s6s(frames, names)
batsman4s6s(frames, names)
frames |
List of batsman |
names |
Names of batsman |
More details can be found in my short video tutorial in Youtubehttps://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
batsmanScoringRateODTT
,
relativeRunsFreqPerfODTT
,
batsmanPerfBoxHist
## Not run: # Get or use the <batsman>.csv obtained with getPlayerDataOD() #sehwag <-getPlayerData(35263,dir="./data", file="sehwag.csv",type="batting", #homeOrAway=c(1,2),result=c(1,2,4)) # retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsman4s6s(pathToFile, "Sachin Tendulkar") #Note: This example uses the file tendulkar.csv from the /data directory. However #you can use any directory as long as the data file exists in that directory. #The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
## Not run: # Get or use the <batsman>.csv obtained with getPlayerDataOD() #sehwag <-getPlayerData(35263,dir="./data", file="sehwag.csv",type="batting", #homeOrAway=c(1,2),result=c(1,2,4)) # retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsman4s6s(pathToFile, "Sachin Tendulkar") #Note: This example uses the file tendulkar.csv from the /data directory. However #you can use any directory as long as the data file exists in that directory. #The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
Compute and plot the number of 6s in the total runs scored by batsman
batsman6s(file, name="A Hookshot")
batsman6s(file, name="A Hookshot")
file |
This is the <batsman>.csv file obtained with an initial getPlayerData() |
name |
Name of the batsman |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # <- getPlayerData(35320,file="tendulkar.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsman6s(pathToFile,"Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. #The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # <- getPlayerData(35320,file="tendulkar.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsman6s(pathToFile,"Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. #The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
This function computed the Average Runs scored on different pitches and also indicates the number of innings played at these venues
batsmanAvgRunsGround(file, name = "A Latecut")
batsmanAvgRunsGround(file, name = "A Latecut")
file |
This is the <batsman>.csv file obtained with an initial getPlayerData() |
name |
Name of the batsman |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
batsmanDismissals
,
batsmanMovingAverage
,
batsmanPerfBoxHist
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # <- getPlayerData(35320,file="tendulkar.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsmanAvgRunsGround(pathToFile,"Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. #The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # <- getPlayerData(35320,file="tendulkar.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsmanAvgRunsGround(pathToFile,"Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. #The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
This function computes the mean runs scored by batsman against different opposition
batsmanAvgRunsOpposition(file, name = "A Latecut")
batsmanAvgRunsOpposition(file, name = "A Latecut")
file |
This is the <batsman>.csv file obtained with an initial getPlayerData() |
name |
Name of the batsman |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
batsmanDismissals
,
batsmanMovingAverage
,
batsmanPerfBoxHist
batsmanAvgRunsGround
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # <- getPlayerData(35320,file="tendulkar.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # retrieve the file path of a data file installed with cricketr path <- system.file("data", "tendulkar.csv", package = "cricketr") batsmanAvgRunsOpposition(path,"Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. ## End(Not run)
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # <- getPlayerData(35320,file="tendulkar.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # retrieve the file path of a data file installed with cricketr path <- system.file("data", "tendulkar.csv", package = "cricketr") batsmanAvgRunsOpposition(path,"Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. ## End(Not run)
Plot the comparative contribution of the batsman in matches that were won and lost as box plots
batsmanContributionWonLost(file, name = "A Hitter")
batsmanContributionWonLost(file, name = "A Hitter")
file |
CSV file of batsman from ESPN Cricinfo obtained with getPlayerDataSp() |
name |
Name of the batsman |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
batsmanMovingAverage
batsmanRunsPredict
batsmanPerfBoxHist
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() #tendulkarsp <-getPlayerDataSp(35320,".","tendulkarsp.csv","batting") # retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkarsp.csv", package = "cricketr") batsmanContributionWonLost(pathToFile,"Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() #tendulkarsp <-getPlayerDataSp(35320,".","tendulkarsp.csv","batting") # retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkarsp.csv", package = "cricketr") batsmanContributionWonLost(pathToFile,"Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
This function computes and plots the cumulative average runs of a batsman
batsmanCumulativeAverageRuns(file,name= "A Leg Glance")
batsmanCumulativeAverageRuns(file,name= "A Leg Glance")
file |
Data frame |
name |
Name of batsman |
None
Maintainer: Tinniam V Ganesh [email protected]
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
batsmanCumulativeStrikeRate
bowlerCumulativeAvgEconRate
bowlerCumulativeAvgWickets
## Not run: # retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsmanCumulativeAverageRuns(pathToFile, "Sachin Tendulkar") ## End(Not run)
## Not run: # retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsmanCumulativeAverageRuns(pathToFile, "Sachin Tendulkar") ## End(Not run)
This function computes and plots the cumulative average strike rate of a batsman
batsmanCumulativeStrikeRate(file,name= "A Leg Glance")
batsmanCumulativeStrikeRate(file,name= "A Leg Glance")
file |
Data frame |
name |
Name of batsman |
None
Maintainer: Tinniam V Ganesh [email protected]
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
batsmanCumulativeAverageRuns
bowlerCumulativeAvgEconRate
bowlerCumulativeAvgWickets
## Not run: pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsmanCumulativeStrikeRate(pathToFile, "Sachin Tendulkar") ## End(Not run)
## Not run: pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsmanCumulativeStrikeRate(pathToFile, "Sachin Tendulkar") ## End(Not run)
Display the dismissals of the batsman (caught, bowled, hit wicket etc) as percentages
batsmanDismissals(file, name="A Squarecut")
batsmanDismissals(file, name="A Squarecut")
file |
This is the <batsman>.csv file obtained with an initial getPlayerData() |
name |
Name of the batsman |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
batsmanMeanStrikeRate
,
batsmanMovingAverage
,
batsmanPerfBoxHist
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # <- getPlayerData(35320,file="tendulkar.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsmanDismissals(pathToFile,"Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # <- getPlayerData(35320,file="tendulkar.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsmanDismissals(pathToFile,"Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
This function calculates the Mean Strike Rate of the batsman for each interval of runs scored
batsmanMeanStrikeRate(file, name = "A Hitter")
batsmanMeanStrikeRate(file, name = "A Hitter")
file |
This is the <batsman>.csv file obtained with an initial getPlayerData() |
name |
Name of the batsman |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
batsmanDismissals
,
batsmanMovingAverage
,
batsmanPerfBoxHist
batsmanPerfBoxHist
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # <- getPlayerData(35320,file="tendulkar.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsmanMeanStrikeRate(pathToFile,"Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # <- getPlayerData(35320,file="tendulkar.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsmanMeanStrikeRate(pathToFile,"Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
This function calculates and plots the Moving Average of the batsman in his career
batsmanMovingAverage(file,name="A Squarecut")
batsmanMovingAverage(file,name="A Squarecut")
file |
This is the <batsman>.csv file obtained with an initial getPlayerData() |
name |
Name of the batsman |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
batsmanDismissals
,
batsmanMeanStrikeRate
,
batsmanPerfBoxHist
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # <- getPlayerData(35320,file="tendulkar.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsmanMovingAverage(pathToFile,"Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # <- getPlayerData(35320,file="tendulkar.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsmanMovingAverage(pathToFile,"Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
Make a boxplot and histogram of the runs scored by the batsman. Plot the Mean, Median, 25th and 75th quantile
batsmanPerfBoxHist(file, name="A Hitter")
batsmanPerfBoxHist(file, name="A Hitter")
file |
This is the <batsman>.csv file obtained with an initial getPlayerData() |
name |
Name of the batsman |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
batsmanDismissals
,
batsmanMeanStrikeRate
,
batsmanMovingAverage
,
batsmanPerfBoxHist
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # <- getPlayerData(35320,file="tendulkar.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsman4s(pathToFile,"Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # <- getPlayerData(35320,file="tendulkar.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsman4s(pathToFile,"Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
This function forecasts the performance of the batsman based on past performances using HoltWinters forecasting model
batsmanPerfForecast(file, name="A Squarecut")
batsmanPerfForecast(file, name="A Squarecut")
file |
This is the <batsman>.csv file obtained with an initial getPlayerData() |
name |
Name of the batsman |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
batsmanDismissals
,
batsmanMeanStrikeRate
,
batsmanMovingAverage
,
batsmanPerfBoxHist
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # <- getPlayerData(35320,file="tendulkar.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsmanPerfForecast(pathToFile,"Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # <- getPlayerData(35320,file="tendulkar.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsmanPerfForecast(pathToFile,"Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
This function plots the runs scored by the batsman at home and overseas
batsmanPerfHomeAway(file, name = "A Hitter")
batsmanPerfHomeAway(file, name = "A Hitter")
file |
CSV file of batsman from ESPN Cricinfo obtained with getPlayerDataSp() |
name |
Name of the batsman |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
batsmanMovingAverage
batsmanRunsPredict
batsmanPerfBoxHist
bowlerContributionWonLost
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() #tendulkarSp <-getPlayerDataSp(35320,".","tendulkarsp.csv","batting") # retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkarsp.csv", package = "cricketr") batsmanPerfHomeAway(pathToFile,"Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() #tendulkarSp <-getPlayerDataSp(35320,".","tendulkarsp.csv","batting") # retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkarsp.csv", package = "cricketr") batsmanPerfHomeAway(pathToFile,"Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
This function calculates frequencies of runs in 10 run buckets and plots this percentage
batsmanRunsFreqPerf(file, name="A Hookshot")
batsmanRunsFreqPerf(file, name="A Hookshot")
file |
This is the <batsman>.csv file obtained with an initial getPlayerData() |
name |
Name of the batsman |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
batsmanDismissals
,
batsmanMovingAverage
,
batsmanPerfBoxHist
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # <- getPlayerData(35320,file="tendulkar.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsmanRunsFreqPerf(pathToFile,"Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # <- getPlayerData(35320,file="tendulkar.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsmanRunsFreqPerf(pathToFile,"Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
This function used K-Means to get the likelihood of getting runs based on clusters of runs the batsman made in the past.It uses K-Means for this.
batsmanRunsLikelihood(file, name = "A Squarecut")
batsmanRunsLikelihood(file, name = "A Squarecut")
file |
This is the <batsman>.csv file obtained with an initial getPlayerData() |
name |
Name of the batsman |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
batsmanMovingAverage
batsmanRunsPredict
battingPerf3d
batsmanContributionWonLost
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # <- getPlayerData(35320,file="tendulkar.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsmanRunsLikelihood(pathToFile,"Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # <- getPlayerData(35320,file="tendulkar.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsmanRunsLikelihood(pathToFile,"Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
Fit a linear regression plane between Runs scored and Minutes in Crease and Balls Faced. This will be used to predict the batsman runs for time in crease and balls faced
batsmanRunsPredict(file, name="A Coverdrive", newdataframe)
batsmanRunsPredict(file, name="A Coverdrive", newdataframe)
file |
This is the <batsman>.csv file obtained with an initial getPlayerData() |
name |
Name of the batsman |
newdataframe |
This is a data frame with 2 columns BF(Balls Faced) and Mins(Minutes) |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
Returns a data frame with the predicted runs for the Balls Faced and Minutes at crease
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
batsmanMovingAverage
battingPerf3d
batsmanContributionWonLost
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # tendulkar <- getPlayerData(35320,file="tendulkar.csv",type="batting", # homeOrAway=c(1,2), result=c(1,2,4)) # Use a single value for BF and Mins BF <- 30 Mins <- 20 # retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsmanRunsPredict(pathToFile,"Sachin Tendulkar",newdataframe=data.frame(BF,Mins)) #or give a data frame #BF <- seq(20,200, length=15) #Mins <- seq(30,220,length=15) #values <- batsmanRunsPredict("../cricketr/data/tendulkar.csv","Sachin Tendulkar", #newdataframe=data.frame(BF,Runs) #print(values) # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # tendulkar <- getPlayerData(35320,file="tendulkar.csv",type="batting", # homeOrAway=c(1,2), result=c(1,2,4)) # Use a single value for BF and Mins BF <- 30 Mins <- 20 # retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsmanRunsPredict(pathToFile,"Sachin Tendulkar",newdataframe=data.frame(BF,Mins)) #or give a data frame #BF <- seq(20,200, length=15) #Mins <- seq(30,220,length=15) #values <- batsmanRunsPredict("../cricketr/data/tendulkar.csv","Sachin Tendulkar", #newdataframe=data.frame(BF,Runs) #print(values) # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
Compute and plot a histogram of the runs scored in ranges of 10
batsmanRunsRanges(file, name="A Hookshot")
batsmanRunsRanges(file, name="A Hookshot")
file |
This is the <batsman>.csv file obtained with an initial getPlayerData() |
name |
Name of the batsman |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
batsmanDismissals
,
batsmanMovingAverage
,
batsmanPerfBoxHist
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # <- getPlayerData(35320,file="tendulkar.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsmanRunsRanges(pathToFile,"Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # <- getPlayerData(35320,file="tendulkar.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") batsmanRunsRanges(pathToFile,"Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
This function computes and plots a 2nd order polynomial between the balls faced and runs scored for ODI or Twenty20
batsmanScoringRateODTT(file, name = "A Hookshot")
batsmanScoringRateODTT(file, name = "A Hookshot")
file |
This is the <batsman>.csv file obtained with an initial getPlayerDataOD() or getPlayerTT() |
name |
Name of the batsman |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
batsman6s
relativeBatsmanSRODTT
relativeRunsFreqPerfODTT
## Not run: # Get or use the <batsman>.csv obtained with getPlayerDataOD() or or getPlayerTT() #sehwag <-getPlayerData(35263,dir="./mytest", file="sehwag.csv",type="batting", # homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "sehwag.csv", package = "cricketr") batsmanScoringRateODTT(pathToFile,"Sehwag") # Note: This example uses the file sehwag.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
## Not run: # Get or use the <batsman>.csv obtained with getPlayerDataOD() or or getPlayerTT() #sehwag <-getPlayerData(35263,dir="./mytest", file="sehwag.csv",type="batting", # homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "sehwag.csv", package = "cricketr") batsmanScoringRateODTT(pathToFile,"Sehwag") # Note: This example uses the file sehwag.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
Make a 3D plot of the Runs scored by batsman vs Minutes in crease and Balls faced. Fit a linear regression plane
battingPerf3d(file, name="A Hookshot")
battingPerf3d(file, name="A Hookshot")
file |
This is the <batsman>.csv file obtained with an initial getPlayerData() |
name |
Name of the batsman |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
batsmanDismissals
,
batsmanMeanStrikeRate
,
batsmanMovingAverage
,
batsmanPerfBoxHist
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # tendulkar<- getPlayerData(35320,file="tendulkar.csv",type="batting", #homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") battingPerf3d(pathToFile,"Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # tendulkar<- getPlayerData(35320,file="tendulkar.csv",type="batting", #homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") battingPerf3d(pathToFile,"Sachin Tendulkar") # Note: The above example uses the file tendulkar.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
This function computes the average wickets taken against different grounds by the bowler. It also shows the number innings at each venue
bowlerAvgWktsGround(file, name = "A Chinaman")
bowlerAvgWktsGround(file, name = "A Chinaman")
file |
This is the <bowler>.csv file obtained with an initial getPlayerData() |
name |
Name of the bowler |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
bowlerWktsFreqPercent
relativeBowlingER
relativeBowlingPerf
## Not run: # Get or use the <bowler>.csv obtained with getPlayerData() # a <- getPlayerData(30176,file="kumble.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "kumble.csv", package = "cricketr") bowlerAvgWktsGround(pathToFile,"Anil Kumble") # Note: This example uses the file kumble.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
## Not run: # Get or use the <bowler>.csv obtained with getPlayerData() # a <- getPlayerData(30176,file="kumble.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "kumble.csv", package = "cricketr") bowlerAvgWktsGround(pathToFile,"Anil Kumble") # Note: This example uses the file kumble.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
This function computes the average wickets taken against different opposition by the bowler. It also shows the number innings against each opposition
bowlerAvgWktsOpposition(file, name = "A Chinaman")
bowlerAvgWktsOpposition(file, name = "A Chinaman")
file |
This is the <bowler>.csv file obtained with an initial getPlayerData() |
name |
Name of the bowler |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
bowlerWktsFreqPercent
relativeBowlingER
relativeBowlingPerf
bowlerAvgWktsGround
## Not run: # Get or use the <bowler>.csv obtained with getPlayerData() # a <- getPlayerData(30176,file="kumble.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "kumble.csv", package = "cricketr") bowlerAvgWktsOpposition(pathToFile,"Anil Kumble") # Note: This example uses the file kumble.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
## Not run: # Get or use the <bowler>.csv obtained with getPlayerData() # a <- getPlayerData(30176,file="kumble.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "kumble.csv", package = "cricketr") bowlerAvgWktsOpposition(pathToFile,"Anil Kumble") # Note: This example uses the file kumble.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
Plot the comparative contribution of the bowler in matches that were won and lost as box plots
bowlerContributionWonLost(file, name = "A Doosra")
bowlerContributionWonLost(file, name = "A Doosra")
file |
CSV file of bowler from ESPN Cricinfo obtained with getPlayerDataSp() |
name |
Name of the bowler |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
bowlerMovingAverage
bowlerPerfForecast
checkBowlerInForm
## Not run: # Get or use the <bowler>.csv obtained with getPlayerDataSp() #kumbleSp <-getPlayerDataSp(30176,".","kumblesp.csv","bowling") # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "kumblesp.csv", package = "cricketr") bowlerContributionWonLost(pathToFile,"Anil Kumble") # Note: This example uses the file kumble.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
## Not run: # Get or use the <bowler>.csv obtained with getPlayerDataSp() #kumbleSp <-getPlayerDataSp(30176,".","kumblesp.csv","bowling") # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "kumblesp.csv", package = "cricketr") bowlerContributionWonLost(pathToFile,"Anil Kumble") # Note: This example uses the file kumble.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
This function computes and plots the cumulative average economy rate of a bowler
bowlerCumulativeAvgEconRate(file,name)
bowlerCumulativeAvgEconRate(file,name)
file |
Data frame |
name |
Name of batsman |
None
Maintainer: Tinniam V Ganesh [email protected]
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
batsmanCumulativeAverageRuns
bowlerCumulativeAvgWickets
batsmanCumulativeStrikeRate
## Not run: ) pathToFile <- system.file("data", "kumble.csv", package = "cricketr") bowlerCumulativeAvgEconRate(pathToFile,"Anil Kumble") ## End(Not run)
## Not run: ) pathToFile <- system.file("data", "kumble.csv", package = "cricketr") bowlerCumulativeAvgEconRate(pathToFile,"Anil Kumble") ## End(Not run)
This function computes and plots the cumulative average wickets of a bowler
bowlerCumulativeAvgWickets(file,name)
bowlerCumulativeAvgWickets(file,name)
file |
Data frame |
name |
Name of batsman |
None
Maintainer: Tinniam V Ganesh [email protected]
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
batsmanCumulativeAverageRuns
bowlerCumulativeAvgEconRate
batsmanCumulativeStrikeRate
## Not run: ) pathToFile <- system.file("data", "kumble.csv", package = "cricketr") bowlerCumulativeAvgWickets(pathToFile,"Anil Kumble") ## End(Not run)
## Not run: ) pathToFile <- system.file("data", "kumble.csv", package = "cricketr") bowlerCumulativeAvgWickets(pathToFile,"Anil Kumble") ## End(Not run)
This function computes the mean economy rate for the wickets taken and plot this
bowlerEconRate(file, name = "A Bowler")
bowlerEconRate(file, name = "A Bowler")
file |
This is the <bowler>.csv file obtained with an initial getPlayerData() |
name |
Name of the bowler |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
bowlerWktsFreqPercent
relativeBowlingER
relativeBowlingPerf
## Not run: # Get or use the <bowler>.csv obtained with getPlayerData() # kumble <- getPlayerData(30176,dir=".", file="kumble.csv",type="batting", # homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "kumble.csv", package = "cricketr") bowlerEconRate(pathToFile,"Anil Kumble") # Note: This example uses the file kumble.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
## Not run: # Get or use the <bowler>.csv obtained with getPlayerData() # kumble <- getPlayerData(30176,dir=".", file="kumble.csv",type="batting", # homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "kumble.csv", package = "cricketr") bowlerEconRate(pathToFile,"Anil Kumble") # Note: This example uses the file kumble.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
This function computes the percentages of wickets taken versus wickets in the bowler's career
bowlerHistWickets(file,name="A Googly")
bowlerHistWickets(file,name="A Googly")
file |
This is the <bowler>.csv file obtained with an initial getPlayerData() |
name |
Name of the bowler |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
bowlerWktsFreqPercent
relativeBowlingER
relativeBowlingPerf
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # <- getPlayerData(30176,file="kumble.csv",type="bowling", homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "kumble.csv", package = "cricketr") bowlerHistWickets(pathToFile, "Anil Kumble") # Note: This example uses the file kumble.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # <- getPlayerData(30176,file="kumble.csv",type="bowling", homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "kumble.csv", package = "cricketr") bowlerHistWickets(pathToFile, "Anil Kumble") # Note: This example uses the file kumble.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
This function plots the wickets taken by a bowler as a time series and plots the moving average over the career
bowlerMovingAverage(file, name = "A Doosra")
bowlerMovingAverage(file, name = "A Doosra")
file |
This is the <bowler>.csv file obtained with an initial getPlayerData() |
name |
Name of the bowler |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
bowlerWktsFreqPercent
relativeBowlingER
relativeBowlingPerf
## Not run: # Get or use the <bowler>.csv obtained with getPlayerData() # a <- getPlayerData(30176,file="kumble.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "kumble.csv", package = "cricketr") bowlerMovingAverage(pathToFile,"Anil Kumble") # Note: This example uses the file kumble.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. ## End(Not run)
## Not run: # Get or use the <bowler>.csv obtained with getPlayerData() # a <- getPlayerData(30176,file="kumble.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "kumble.csv", package = "cricketr") bowlerMovingAverage(pathToFile,"Anil Kumble") # Note: This example uses the file kumble.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. ## End(Not run)
This function forecasts the performance of the bowler based on past performances using HoltWinters forecasting model
bowlerPerfForecast(file, name = "A Googly")
bowlerPerfForecast(file, name = "A Googly")
file |
This is the <bowler>.csv file obtained with an initial getPlayerData() |
name |
Name of the bowler |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
bowlerEconRate
,
bowlerMovingAverage
,
bowlerContributionWonLost
## Not run: # Get or use the <bowler>.csv obtained with getPlayerData() # a <- getPlayerData(30176,file="kumble.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "kumble.csv", package = "cricketr") bowlerPerfForecast(pathToFile,"Anil Kumble") # Note: This example uses the file kumble.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
## Not run: # Get or use the <bowler>.csv obtained with getPlayerData() # a <- getPlayerData(30176,file="kumble.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "kumble.csv", package = "cricketr") bowlerPerfForecast(pathToFile,"Anil Kumble") # Note: This example uses the file kumble.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
This function plots the Wickets taken by the batsman at home and overseas
bowlerPerfHomeAway(file, name = "A Googly")
bowlerPerfHomeAway(file, name = "A Googly")
file |
CSV file of the bowler from ESPN Cricinfo (for e.g. Kumble's profile no:30176) |
name |
Name of bowler |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
bowlerMovingAverage
bowlerPerfForecast
checkBowlerInForm
bowlerContributionWonLost
## Not run: # Get or use the <bowler>.csv obtained with getPlayerDataSp() #kumbleSp <-getPlayerDataSp(30176,".","kumblesp.csv","bowling") # Retrieve the file path of a data file installed with cricketr path <- system.file("data", "kumblesp.csv", package = "cricketr") bowlerPerfHomeAway(path,"Anil Kumble") # Note: This example uses the file kumble.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. ## End(Not run)
## Not run: # Get or use the <bowler>.csv obtained with getPlayerDataSp() #kumbleSp <-getPlayerDataSp(30176,".","kumblesp.csv","bowling") # Retrieve the file path of a data file installed with cricketr path <- system.file("data", "kumblesp.csv", package = "cricketr") bowlerPerfHomeAway(path,"Anil Kumble") # Note: This example uses the file kumble.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. ## End(Not run)
This function computes and plots the Mean number of deliveries versus wickets taken for bowlers in Twenty20 Internation
bowlerWktRateTT(file, name = "A Bowler")
bowlerWktRateTT(file, name = "A Bowler")
file |
his is the <bowler>.csv file obtained with an initial getPlayerDataTT() |
name |
Name of the bowler |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
bowlerWktsFreqPercent
relativeBowlingER
relativeBowlingPerf
## Not run: # Get or use the <bowler>.csv obtained with getPlayerData() # a <- getPlayerDataTT(26421,dir=".",file="ashwin.csv",type="bowling", # homeOrAway=c(1,2,3), result=c(1,2,3,5)) # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "ashwin.csv", package = "cricketr") bowlerWktRateTT(pathToFile,"R Ashwin") # Note: This example uses the file kumble.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
## Not run: # Get or use the <bowler>.csv obtained with getPlayerData() # a <- getPlayerDataTT(26421,dir=".",file="ashwin.csv",type="bowling", # homeOrAway=c(1,2,3), result=c(1,2,3,5)) # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "ashwin.csv", package = "cricketr") bowlerWktRateTT(pathToFile,"R Ashwin") # Note: This example uses the file kumble.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
This function calculates the Wickets frequency as a percentage of total wickets taken and plots this agains the wickets taken.
bowlerWktsFreqPercent(file, name="A Bowler")
bowlerWktsFreqPercent(file, name="A Bowler")
file |
This is the <bowler>.csv file obtained with an initial getPlayerData() |
name |
Name of the bowler |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
bowlerWktsFreqPercent
relativeBowlingER
relativeBowlingPerf
## Not run: # Get or use the <bowler>.csv obtained with getPlayerData() # a <- getPlayerData(30176,file="kumble.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "kumble.csv", package = "cricketr") bowlerWktsFreqPercent(pathToFile,"Anil Kumble") # Note: This example uses the file kumble.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
## Not run: # Get or use the <bowler>.csv obtained with getPlayerData() # a <- getPlayerData(30176,file="kumble.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "kumble.csv", package = "cricketr") bowlerWktsFreqPercent(pathToFile,"Anil Kumble") # Note: This example uses the file kumble.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
This function creates boxplots on the runs conceded for wickets taken for the bowler
bowlerWktsRunsPlot(file, name = "A Googly")
bowlerWktsRunsPlot(file, name = "A Googly")
file |
This is the <bowler>.csv file obtained with an initial getPlayerData() |
name |
Name of the bowler |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
bowlerWktsFreqPercent
relativeBowlingER
relativeBowlingPerf
bowlerHistWickets
## Not run: # Get or use the <bowler>.csv obtained with getPlayerData() # a <- getPlayerData(30176,file="kumble.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "kumble.csv", package = "cricketr") bowlerWktsRunsPlot(pathToFile,"Anil Kumble") # Note: This example uses the file kumble.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
## Not run: # Get or use the <bowler>.csv obtained with getPlayerData() # a <- getPlayerData(30176,file="kumble.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "kumble.csv", package = "cricketr") bowlerWktsRunsPlot(pathToFile,"Anil Kumble") # Note: This example uses the file kumble.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
This function checks whether the batsman is In-Form or Out-Of-Form by doing hypothesis testing and generating a p-value. The last 10 percent of runs scored (sample) are used as a sample against the rest 90 percent of runs scored (population) by the batsman.A significance value of 0.05 is used. The lower tail is checked. The NULL hypothesis is that the batsman is In-Form with the sample mean being within 95 percent confidence interval. If the sample mean is outside this 95 percent range and the p-value is less than the significance value the batsman is considered to be Out-Of-Form
checkBatsmanInForm(file, name = "A Hitter", alpha = 0.05)
checkBatsmanInForm(file, name = "A Hitter", alpha = 0.05)
file |
This is the <batsman>.csv file obtained with an initial getPlayerData() |
name |
Name of the batsman |
alpha |
Significance value |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
batsmanDismissals
,
batsmanMeanStrikeRate
,
batsmanMovingAverage
,
batsmanPerfBoxHist
## Not run: # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") checkBatsmanInForm(pathToFile,"Sachin Tendulkar") #Note: This example uses the file tendulkar.csv from the /data directory. However #you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
## Not run: # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") checkBatsmanInForm(pathToFile,"Sachin Tendulkar") #Note: This example uses the file tendulkar.csv from the /data directory. However #you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
This function checks whether the bowler is In-Form or Out-Of-Form by doing hypothesis testing and generating a p-value. The last 10 percent of runs scored (sample) are used as a sample against the rest 90 percent of runs scored (population) by the bowler.A significance value of 0.05 is used. The lower tail is checked. The NULL hypothesis is that the bowler is In-Form with the sample mean being within 95 percent confidence interval. If the sample mean is outside this 95 percent range and the p-value is less than the significance value the bowler is considered to be Out-Of-Form
checkBowlerInForm(file, name = "A N Inswinger", alpha = 0.05)
checkBowlerInForm(file, name = "A N Inswinger", alpha = 0.05)
file |
This is the <bowler>.csv file obtained with an initial getPlayerData() |
name |
Name of the bowler |
alpha |
Significance value |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.wordpress.com/
bowlerMovingAverage
batsmanPerfForecast
bowlerContributionWonLost
## Not run: # Get or use the <bowler>.csv obtained with getPlayerData() # a <- getPlayerData(30176,file="kumble.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "kumble.csv", package = "cricketr") checkBowlerInForm(pathToFile,"Anil Kumble") #Note: This example uses the file kumble.csv from the /data directory. However #you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
## Not run: # Get or use the <bowler>.csv obtained with getPlayerData() # a <- getPlayerData(30176,file="kumble.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr pathToFile <- system.file("data", "kumble.csv", package = "cricketr") checkBowlerInForm(pathToFile,"Anil Kumble") #Note: This example uses the file kumble.csv from the /data directory. However #you can use any directory as long as the data file exists in that directory. # The general format is pkg-function(pathToFile,par1,...) ## End(Not run)
The function removes rows from the batsman dataframe where the batsman did not bat (DNB) or the team did not bat (TDNB). COnverts not outs '*' (97*, 128*) to 97,128 by stripping the '*' character. It picks all the complete cases and returns the data frame
clean(file)
clean(file)
file |
CSV file with the batsman data obtained with getPlayerData |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
Returns the cleaned batsman dataframe
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
cleanBowlerData
getPlayerData
batsman4s
batsmanMovingAverage
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # <- getPlayerData(35320,file="tendulkar.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # clean the dataframe pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") clean(pathToFile) # Note: This example uses the file kumble.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. ## End(Not run)
## Not run: # Get or use the <batsman>.csv obtained with getPlayerData() # <- getPlayerData(35320,file="tendulkar.csv",type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # clean the dataframe pathToFile <- system.file("data", "tendulkar.csv", package = "cricketr") clean(pathToFile) # Note: This example uses the file kumble.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. ## End(Not run)
Clean the bowler's CSV fileand remove rows DNB(Did not bowl) & TDNB (Team did not bowl). Also normalize all 8 ball over to a 6 ball over for earlier bowlers
cleanBowlerData(file)
cleanBowlerData(file)
file |
The <bowler>.csv file |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
A cleaned bowler data frame with complete cases
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
## Not run: # Get bowling data and store in file for future # kumble <- getPlayerData(30176,dir="./mytest", file="kumble.csv",type="bowling", # homeOrAway=c(1),result=c(1,2)) pathToFile <- system.file("data", "kumble.csv", package = "cricketr") cleanBowlerData(pathToFile) # Note: This example uses the file kumble.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. ## End(Not run)
## Not run: # Get bowling data and store in file for future # kumble <- getPlayerData(30176,dir="./mytest", file="kumble.csv",type="bowling", # homeOrAway=c(1),result=c(1,2)) pathToFile <- system.file("data", "kumble.csv", package = "cricketr") cleanBowlerData(pathToFile) # Note: This example uses the file kumble.csv from the /data directory. However # you can use any directory as long as the data file exists in that directory. ## End(Not run)
This function cleans the team data for Test, ODI and T20
cleanTeamData(df,matchType)
cleanTeamData(df,matchType)
df |
Data frame |
matchType |
Match type - Test, ODI, T20 |
The cleaned Data frame
Maintainer: Tinniam V Ganesh [email protected]
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
teamWinLossStatusVsOpposition
teamWinLossStatusAtGrounds
plotTimelineofWinsLosses
## Not run: #Get the team data for India for Tests df<-getTeamDataHomeAway(file="india.csv",teamName="India",matchType='Test') df1 <-cleanTeamData(df,"Test") ## End(Not run)
## Not run: #Get the team data for India for Tests df<-getTeamDataHomeAway(file="india.csv",teamName="India",matchType='Test') df1 <-cleanTeamData(df,"Test") ## End(Not run)
Data set for AB Devilliers
data("devilliers")
data("devilliers")
The format is: chr "devilliers"
Data set for AB Devilliers
https://www.espncricinfo.com/ci/content/stats/index.html
https://www.espncricinfo.com/ci/content/stats/index.html
Calculate the mean Economy Rate
ER(file)
ER(file)
file |
Input |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
Data set for Sourav Ganguly
data("ganguly")
data("ganguly")
The format is: chr "ganguly"
Data set for Sourav Ganguly
https://www.espncricinfo.com/ci/content/stats/index.html
https://www.espncricinfo.com/ci/content/stats/index.html
Data set for Chris Gayle
data("gayle")
data("gayle")
The format is: chr "gayle"
Data set for Chris Gayle
https://www.espncricinfo.com/ci/content/stats/index.html
https://www.espncricinfo.com/ci/content/stats/index.html
This function returns the number of the match type
getMatchType(matchType)
getMatchType(matchType)
matchType |
The match type - Test, ODI or T20 |
The numerical value of match type
Maintainer: Tinniam V Ganesh [email protected]
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
teamWinLossStatusVsOpposition
teamWinLossStatusAtGrounds
plotTimelineofWinsLosses
## Not run: #Get the team data for India for Tests match <-getMatchType("Test") ## End(Not run)
## Not run: #Get the team data for India for Tests match <-getMatchType("Test") ## End(Not run)
Get the player data given the profile of the batsman. The allowed inputs are home,away or both and won,lost or draw of matches. The data is stored in a <player>.csv file in a directory specified. This function also returns a data frame of the player
getPlayerData(profile,opposition="",host="",dir="./data",file="player001.csv", type="batting", homeOrAway=c(1,2,3),result=c(1,2,4))
getPlayerData(profile,opposition="",host="",dir="./data",file="player001.csv", type="batting", homeOrAway=c(1,2,3),result=c(1,2,4))
profile |
This is the profile number of the player to get data. This can be obtained from https://www.espncricinfo.com/ci/content/player/index.html. Type the name of the player and click search. This will display the details of the player. Make a note of the profile ID. For e.g For Sachin Tendulkar this turns out to be httsp://www.espncricinfo.com/india/content/player/35320.html. Hence the profile for Sachin is 35320 |
opposition |
The numerical value of the opposition country e.g.Australia,India, England etc. The values are Australia:2,Bangladesh:25,England:1,India:6,New Zealand:5,Pakistan:7,South Africa:3,Sri Lanka:8, West Indies:4, Zimbabwe:9 |
host |
The numerical value of the host country e.g.Australia,India, England etc. The values are Australia:2,Bangladesh:25,England:1,India:6,New Zealand:5,Pakistan:7,South Africa:3,Sri Lanka:8, West Indies:4, Zimbabwe:9 |
dir |
Name of the directory to store the player data into. If not specified the data is stored in a default directory "./data". Default="./data" |
file |
Name of the file to store the data into for e.g. tendulkar.csv. This can be used for subsequent functions. Default="player001.csv" |
type |
type of data required. This can be "batting" or "bowling" |
homeOrAway |
This is onw of 1,2,3. 1 is for home 2 is for away and 3 is for neutral venue |
result |
This is a vector that can take values 1,2,4. 1 - won match 2- lost match 4- draw |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
Returns the player's dataframe
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
## Not run: # Both home and away. Result = won,lost and drawn tendulkar <-getPlayerData(35320,dir="../cricketr/data", file="tendulkar1.csv", type="batting", homeOrAway=c(1,2,3),result=c(1,2,4)) # Only away. Get data only for won and lost innings tendulkar <-getPlayerData(35320,dir="../cricketr/data", file="tendulkar2.csv", type="batting",homeOrAway=c(2),result=c(1,2)) # Get bowling data and store in file for future kumble <- getPlayerData(30176,dir="../cricketr/data",file="kumble1.csv", type="bowling",homeOrAway=c(1),result=c(1,2)) #Get the Tendulkar's Performance against Australia in Australia tendulkar <-getPlayerData(35320, opposition = 2,host=2,dir=".", file="tendulkarVsAusInAus.csv",type="batting") ## End(Not run)
## Not run: # Both home and away. Result = won,lost and drawn tendulkar <-getPlayerData(35320,dir="../cricketr/data", file="tendulkar1.csv", type="batting", homeOrAway=c(1,2,3),result=c(1,2,4)) # Only away. Get data only for won and lost innings tendulkar <-getPlayerData(35320,dir="../cricketr/data", file="tendulkar2.csv", type="batting",homeOrAway=c(2),result=c(1,2)) # Get bowling data and store in file for future kumble <- getPlayerData(30176,dir="../cricketr/data",file="kumble1.csv", type="bowling",homeOrAway=c(1),result=c(1,2)) #Get the Tendulkar's Performance against Australia in Australia tendulkar <-getPlayerData(35320, opposition = 2,host=2,dir=".", file="tendulkarVsAusInAus.csv",type="batting") ## End(Not run)
This function saves the players data as a CSV file and also returns a data frame. A new column home/away/neutral is added
getPlayerDataHA(profileNo,tdir=".",tfile="player001.csv",type="batting", matchType="Test")
getPlayerDataHA(profileNo,tdir=".",tfile="player001.csv",type="batting", matchType="Test")
profileNo |
The profile number of the player |
tdir |
The name of the directory to save the CSV file |
tfile |
The name of the CSV file |
type |
This parameter should be 'batting' for batsman data and 'bowling' for bowlers |
matchType |
Match type - Test, ODI or T20 |
dataframe
Maintainer: Tinniam V Ganesh [email protected]
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
teamWinLossStatusVsOpposition
batsman4s
## Not run: #Get data for Tendulkar df=getPlayerDataHA(profileno=35320,tfile="tendulkarHA.csv") #Get the bowling data for Jadeja in ODIs df=getPlayerDataHA(profileNo=234675,tfile="jadejaODIHA.csv",type="bowling",matchType='ODI') # Get the data for Kohli in T20s for batting df=getPlayerDataHA(profileNo=253802,tfile="kohliT20HA.csv",matchType="T20") ## End(Not run)
## Not run: #Get data for Tendulkar df=getPlayerDataHA(profileno=35320,tfile="tendulkarHA.csv") #Get the bowling data for Jadeja in ODIs df=getPlayerDataHA(profileNo=234675,tfile="jadejaODIHA.csv",type="bowling",matchType='ODI') # Get the data for Kohli in T20s for batting df=getPlayerDataHA(profileNo=253802,tfile="kohliT20HA.csv",matchType="T20") ## End(Not run)
Get the player data given the profile of the batsman. The allowed inputs are home,away or both and won,lost or draw of matches. The data is stored in a <player>.csv file in a directory specified. This function also returns a data frame of the player
getPlayerDataOD(profile, opposition="",host="",dir = "../", file = "player001.csv", type = "batting", homeOrAway = c(1, 2, 3), result = c(1, 2, 3,5))
getPlayerDataOD(profile, opposition="",host="",dir = "../", file = "player001.csv", type = "batting", homeOrAway = c(1, 2, 3), result = c(1, 2, 3,5))
profile |
This is the profile number of the player to get data. This can be obtained from https://www.espncricinfo.com/ci/content/player/index.html. Type the name of the player and click search. This will display the details of the player. Make a note of the profile ID. For e.g For Virender Sehwag this turns out to be https://www.espncricinfo.com/india/content/player/35263.html. Hence the profile for Sehwag is 35263 |
opposition |
The numerical value of the opposition country e.g.Australia,India, England etc. The values are Australia:2,Bangladesh:25,Bermuda:12, England:1,Hong Kong:19,India:6,Ireland:29, Netherlands:15,New Zealand:5,Pakistan:7,Scotland:30,South Africa:3,Sri Lanka:8,United Arab Emirates:27, West Indies:4, Zimbabwe:9; Africa XI:405 Note: If no value is entered for opposition then all teams are considered |
host |
The numerical value of the host country e.g.Australia,India, England etc. The values are Australia:2,Bangladesh:25,England:1,India:6,Ireland:29,Malaysia:16,New Zealand:5,Pakistan:7, Scotland:30,South Africa:3,Sri Lanka:8,United Arab Emirates:27,West Indies:4, Zimbabwe:9 Note: If no value is entered for host then all host countries are considered |
dir |
Name of the directory to store the player data into. If not specified the data is stored in a default directory "../data". Default="../data" |
file |
Name of the file to store the data into for e.g. tendulkar.csv. This can be used for subsequent functions. Default="player001.csv" |
type |
type of data required. This can be "batting" or "bowling" |
homeOrAway |
This is vector with either or all 1,2, 3. 1 is for home 2 is for away, 3 is for neutral venue |
result |
This is a vector that can take values 1,2,3,5. 1 - won match 2- lost match 3-tied 5- no result |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
Returns the player's dataframe
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
## Not run: # Both home and away. Result = won,lost and drawn sehwag <-getPlayerDataOD(35263,dir="../cricketr/data", file="sehwag1.csv", type="batting", homeOrAway=c(1,2),result=c(1,2,3,5)) # Only away. Get data only for won and lost innings sehwag <-getPlayerDataOD(35263,dir="../cricketr/data", file="sehwag2.csv", type="batting",homeOrAway=c(2),result=c(1,2)) # Get bowling data and store in file for future malinga <- getPlayerData(49758,dir="../cricketr/data",file="malinga1.csv", type="bowling") # Get Dhoni's ODI record in Australia against Australua dhoni <- getPlayerDataOD(28081,opposition = 2,host=2,dir=".", file="dhoniVsAusinAusOD",type="batting") ## End(Not run)
## Not run: # Both home and away. Result = won,lost and drawn sehwag <-getPlayerDataOD(35263,dir="../cricketr/data", file="sehwag1.csv", type="batting", homeOrAway=c(1,2),result=c(1,2,3,5)) # Only away. Get data only for won and lost innings sehwag <-getPlayerDataOD(35263,dir="../cricketr/data", file="sehwag2.csv", type="batting",homeOrAway=c(2),result=c(1,2)) # Get bowling data and store in file for future malinga <- getPlayerData(49758,dir="../cricketr/data",file="malinga1.csv", type="bowling") # Get Dhoni's ODI record in Australia against Australua dhoni <- getPlayerDataOD(28081,opposition = 2,host=2,dir=".", file="dhoniVsAusinAusOD",type="batting") ## End(Not run)
This function saves the filtered players data as a CSV file for matches against specified opposition, at home.away venues for a specified interval
getPlayerDataOppnHA(infile,outfile,dir=".",opposition=c("all"),homeOrAway=c("all"), startDate="2001-01-01",endDate="2019-01-01")
getPlayerDataOppnHA(infile,outfile,dir=".",opposition=c("all"),homeOrAway=c("all"), startDate="2001-01-01",endDate="2019-01-01")
infile |
The input CSV HA file for the player |
outfile |
The name of the output CSV file which is filtered file based on opposition,home/away for a period |
dir |
The name of the directory to store output file |
opposition |
This is a vector of opposition for e.g. c("Australia","India","South Africa"). Default is c("all") |
homeOrAway |
This is a vector of "home","away" or "neutral". Default is c("all") |
startDate |
This is a date from which you would like the data for player "yyyy-mm-dd" format |
endDate |
This is a end date till which you need data to be filtered of "yyyy-mm-dd" format |
dataframe
Maintainer: Tinniam V Ganesh [email protected]
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
teamWinLossStatusVsOpposition
batsman4s6s
## Not run: #Get data for Kohli against England in 'away' venues in the year 2014 df=getPlayerDataOppnHA(infile="kohliHA.csv",outfile="kohliEAN2014.csv", opposition=c("England","Australia","New Zealand"), homeOrAway=c("away"),startDate="2014-01-01",endDate="2015-01-01") # Get data for Tendulkar between 2001 and 2002 df1=getPlayerDataOppnHA(file,outfile="tendulkar2001.csv",startDate="2001-01-01", endDate="2002-01-01") ## End(Not run)
## Not run: #Get data for Kohli against England in 'away' venues in the year 2014 df=getPlayerDataOppnHA(infile="kohliHA.csv",outfile="kohliEAN2014.csv", opposition=c("England","Australia","New Zealand"), homeOrAway=c("away"),startDate="2014-01-01",endDate="2015-01-01") # Get data for Tendulkar between 2001 and 2002 df1=getPlayerDataOppnHA(file,outfile="tendulkar2001.csv",startDate="2001-01-01", endDate="2002-01-01") ## End(Not run)
This function is a specialized version of getPlayer Data. This function gets the players data along with details on matches' venue (home/abroad) and the result of match(won,lost,drawn) as 2 separate columns (ha & result). The column ha has 1:home and 2: overseas. The column result has values 1:won , 2;lost and :drawn match
getPlayerDataSp(profileNo, tdir = "./data", tfile = "player001.csv", ttype = "batting")
getPlayerDataSp(profileNo, tdir = "./data", tfile = "player001.csv", ttype = "batting")
profileNo |
This is the profile number of the player to get data. This can be obtained from https://www.espncricinfo.com/ci/content/player/index.html. Type the name of the player and click search. This will display the details of the player. Make a note of the profile ID. For e.g For Sachin Tendulkar this turns out to be https://www.espncricinfo.com/india/content/player/35320.html. Hence the profile for Sachin is 35320 |
tdir |
Name of the directory to store the player data into. If not specified the data is stored in a default directory "./data". Default="./tdata" |
tfile |
Name of the file to store the data into for e.g. tendulkar.csv. This can be used for subsequent functions. Default="player001.csv" |
ttype |
type of data required. This can be "batting" or "bowling" |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
Returns the player's dataframe along with the homeAway and the result columns
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
## Not run: # Only away. Get data only for won and lost innings tendulkar <-getPlayerDataSp(35320,tdir="../cricketr/data", tfile="tendulkarsp.csv",ttype="batting") # Get bowling data and store in file for future kumble <- getPlayerDataSp(30176,tdir="../cricketr/data",tfile="kumblesp.csv",ttype="bowling") ## End(Not run)
## Not run: # Only away. Get data only for won and lost innings tendulkar <-getPlayerDataSp(35320,tdir="../cricketr/data", tfile="tendulkarsp.csv",ttype="batting") # Get bowling data and store in file for future kumble <- getPlayerDataSp(30176,tdir="../cricketr/data",tfile="kumblesp.csv",ttype="bowling") ## End(Not run)
Get the Twenty20 player data given the profile of the batsman/bowler. The allowed inputs are home,away, neutralboth and won,lost,tied or no result of matches. The data is stored in a <player>.csv file in a directory specified. This function also returns a data frame of the player
getPlayerDataTT(profile, opposition="",host="",dir = "./data", file = "player001.csv", type = "batting", homeOrAway = c(1, 2, 3), result = c(1, 2, 3,5))
getPlayerDataTT(profile, opposition="",host="",dir = "./data", file = "player001.csv", type = "batting", homeOrAway = c(1, 2, 3), result = c(1, 2, 3,5))
profile |
This is the profile number of the player to get data. This can be obtained from https://www.espncricinfo.com/ci/content/player/index.html. Type the name of the player and click search. This will display the details of the player. Make a note of the profile ID. For e.g For Virat Kohli this turns out to be 253802 https://www.espncricinfo.com/india/content/player/35263.html. Hence the profile for Sehwag is 35263 |
opposition |
The numerical value of the opposition country e.g.Australia,India, England etc. The values are Afghanistan:40,Australia:2,Bangladesh:25,England:1,Hong Kong:19,India:6,Ireland:29, New Zealand:5,Pakistan:7,Scotland:30,South Africa:3,Sri Lanka:8,United Arab Emirates:27, West Indies:4, Zimbabwe:9; Note: If no value is entered for opposition then all teams are considered |
host |
The numerical value of the host country e.g.Australia,India, England etc. The values are Australia:2,Bangladesh:25,England:1,India:6,New Zealand:5, South Africa:3,Sri Lanka:8,United States of America:11,West Indies:4, Zimbabwe:9 Note: If no value is entered for host then all host countries are considered |
dir |
Name of the directory to store the player data into. If not specified the data is stored in a default directory "./data". Default="./data" |
file |
Name of the file to store the data into for e.g. kohli.csv. This can be used for subsequent functions. Default="player001.csv" |
type |
type of data required. This can be "batting" or "bowling" |
homeOrAway |
This is vector with either or all 1,2, 3. 1 is for home 2 is for away, 3 is for neutral venue |
result |
This is a vector that can take values 1,2,3,5. 1 - won match 2- lost match 3-tied 5- no result |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
Returns the player's dataframe
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
## Not run: # Only away. Get data only for won and lost innings kohli <-getPlayerDataTT(253802,dir="../cricketr/data", file="kohli1.csv", type="batting") # Get bowling data and store in file for future ashwin <- getPlayerDataTT(26421,dir="../cricketr/data",file="ashwin1.csv", type="bowling") kohli <-getPlayerDataTT(253802,opposition = 2,host=2,dir="../cricketr/data", file="kohli1.csv",type="batting") ## End(Not run)
## Not run: # Only away. Get data only for won and lost innings kohli <-getPlayerDataTT(253802,dir="../cricketr/data", file="kohli1.csv", type="batting") # Get bowling data and store in file for future ashwin <- getPlayerDataTT(26421,dir="../cricketr/data",file="ashwin1.csv", type="bowling") kohli <-getPlayerDataTT(253802,opposition = 2,host=2,dir="../cricketr/data", file="kohli1.csv",type="batting") ## End(Not run)
This function returns team data as a CSV file and/or a dataframe for Test, ODI and T20
getTeamData(dir=".",file="team001.csv",matchType="Test", homeOrAway=c(1,2,3),result=c(1,2,3,4),teamView="bat",save=FALSE,teamName)
getTeamData(dir=".",file="team001.csv",matchType="Test", homeOrAway=c(1,2,3),result=c(1,2,3,4),teamView="bat",save=FALSE,teamName)
dir |
The directory where the team data CSV file be saved |
file |
The name of the CSV file to save to |
matchType |
The match type - Test, ODI , T20 |
homeOrAway |
Whether the data has to be got for home-1, away(overseas)-2 or neutral -3 |
result |
The result of the match for which data is to be saved - won-1, lost -2, tied-3, draw-4 |
teamView |
This can be 'bat' - batting team or 'bowl' - bowling team |
save |
This can be set as TRUE or FALSE |
teamName |
This is team name |
The required data frame
Maintainer: Tinniam V Ganesh [email protected]
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
teamWinLossStatusVsOpposition
teamWinLossStatusAtGrounds
plotTimelineofWinsLosses
## Not run: #Get the team data for India for Tests df=getTeamData(dir=".",file="australia.csv", matchType="Test",homeOrAway=c(1,2,3), result=c(1,2,3, 4),teamView='bat',teamName="Australia") ## End(Not run)
## Not run: #Get the team data for India for Tests df=getTeamData(dir=".",file="australia.csv", matchType="Test",homeOrAway=c(1,2,3), result=c(1,2,3, 4),teamView='bat',teamName="Australia") ## End(Not run)
This function returns team data as a CSV file and/or a dataframe for Test, ODI and T20 with an additional column showing home, away or neutral venue where the match was played
getTeamDataHomeAway(dir=".",teamView="bat",matchType="Test",file="team001HA.csv", save=TRUE,teamName)
getTeamDataHomeAway(dir=".",teamView="bat",matchType="Test",file="team001HA.csv", save=TRUE,teamName)
dir |
The directory where the team data CSV file be saved |
teamView |
Team view can be either 'bat' (batting team) or 'bowl' (bowling team) |
matchType |
The match type - Test, ODI , T20 |
file |
The name of te file to save to |
save |
This can be TRUE or FALSE |
teamName |
Team name is the team namely - Australia, India, England etc |
The required data frame
Maintainer: Tinniam V Ganesh [email protected]
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
teamWinLossStatusVsOpposition
teamWinLossStatusAtGrounds
plotTimelineofWinsLosses
## Not run: #Get the team data for India for Tests getTeamDataHomeAway(teamName="India",file="india.csv") ## End(Not run)
## Not run: #Get the team data for India for Tests getTeamDataHomeAway(teamName="India",file="india.csv") ## End(Not run)
This function returns the number of the Team for which analysis is to be done
getTeamNumber(teamName,matchType)
getTeamNumber(teamName,matchType)
teamName |
The name of the team e.g Australia, India, Ghana etc |
matchType |
The match type - Test, ODI or T20 |
The numerical value of the team
Maintainer: Tinniam V Ganesh [email protected]
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
teamWinLossStatusVsOpposition
teamWinLossStatusAtGrounds
plotTimelineofWinsLosses
## Not run: #Get the team data for India for Tests teamNi <-getTeamNumber(teamName="India",matchType="Test") ## End(Not run)
## Not run: #Get the team data for India for Tests teamNi <-getTeamNumber(teamName="India",matchType="Test") ## End(Not run)
CSV file Virat Kohl
data("kohli")
data("kohli")
The format is: chr "kohli"
CSV file Virat Kohli
https://www.espncricinfo.com/ci/content/stats/index.html
https://www.espncricinfo.com/ci/content/stats/index.html
Data set for Virat Kohli
data("kohli1")
data("kohli1")
The format is: chr "kohli1"
Data set for Virat Kohli
https://www.espncricinfo.com/ci/content/stats/index.html
https://www.espncricinfo.com/ci/content/stats/index.html
Data set for Anil Kumble
data("kumble")
data("kumble")
The format is: chr "kumble"
Data set for Anil Kumble
https://www.espncricinfo.com/ci/content/stats/index.html
https://www.espncricinfo.com/ci/content/stats/index.html
Data set for Anil Kumble
data("kumble1")
data("kumble1")
The format is: chr "kumble1"
Data set for Anil Kumble
https://www.espncricinfo.com/ci/content/stats/index.html
https://www.espncricinfo.com/ci/content/stats/index.html
Data set for Anil Kumble
data("kumblesp")
data("kumblesp")
The format is: chr "kumblesp"
Data set for Anil Kumble
https://www.espncricinfo.com/ci/content/stats/index.html
https://www.espncricinfo.com/ci/content/stats/index.html
Data set for Lasith Malinga
data("malinga")
data("malinga")
The format is: chr "malinga"
Data set for Lasith Malinga
https://www.espncricinfo.com/ci/content/stats/index.html
https://www.espncricinfo.com/ci/content/stats/index.html
data(malinga) ## maybe str(malinga) ; plot(malinga) ...
data(malinga) ## maybe str(malinga) ; plot(malinga) ...
Data set for Lasith Malinga
data("malinga1")
data("malinga1")
The format is: chr "malinga1"
Data set for Lasith Malinga
https://www.espncricinfo.com/ci/content/stats/index.html
https://www.espncricinfo.com/ci/content/stats/index.html
Data set for Glenn Maxwell
data("maxwell")
data("maxwell")
The format is: chr "maxwell"
Data set for Glenn Maxwell
https://www.espncricinfo.com/ci/content/stats/index.html
https://www.espncricinfo.com/ci/content/stats/index.html
Data set for Ajantha Mendis
data("mendis")
data("mendis")
The format is: chr "mendis"
Data set for Ajantha Mendis
https://www.espncricinfo.com/ci/content/stats/index.html
https://www.espncricinfo.com/ci/content/stats/index.html
Data set for Mitchell Johnson
data("mitchell")
data("mitchell")
The format is: chr "mitchell"
Data set for Mitchell Johnson
https://www.espncricinfo.com/ci/content/stats/index.html
https://www.espncricinfo.com/ci/content/stats/index.html
Data set for Muthiah Muralitharan
data("murali")
data("murali")
The format is: chr "murali"
Data set for Muthiah Muralitharan
https://www.espncricinfo.com/ci/content/stats/index.html
https://www.espncricinfo.com/ci/content/stats/index.html
Data set for Sunil Narine
data("narine")
data("narine")
The format is: chr "narine"
Data set for Sunil Narine
https://www.espncricinfo.com/ci/content/stats/index.html
https://www.espncricinfo.com/ci/content/stats/index.html
Calculate the percent runs in each 10 run range
percentRuns(file)
percentRuns(file)
file |
Input |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
Calculate the percentage wickets taken by bowler
percentWkts(file)
percentWkts(file)
file |
Data frame |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None.
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
This function returns plots a time line of won,lost,draw,tied or no result for a team against other teams in home/away or neutral venues
plotTimelineofWinsLosses(file,teamName,opposition=c("all"),homeOrAway=c("all"), startDate="2001-01-01",endDate="2019-01-01",matchType="Test")
plotTimelineofWinsLosses(file,teamName,opposition=c("all"),homeOrAway=c("all"), startDate="2001-01-01",endDate="2019-01-01",matchType="Test")
file |
The CSV file for which the plot is required |
teamName |
The name of the team for which plot is required |
opposition |
Opposition is a vector namely c("all") or c("Australia", "India", "England") |
homeOrAway |
This parameter is a vector which is either c("all") or a vector of venues c("home","away","neutral") |
startDate |
The start date from which time line is required |
endDate |
The end data for which the time line plot is required |
matchType |
Match type - Test, ODI or T20 |
None
Maintainer: Tinniam V Ganesh [email protected]
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
teamWinLossStatusVsOpposition
teamWinLossStatusAtGrounds
plotTimelineofWinsLosses
## Not run: #Get the team data for India for Tests df <- getTeamDataHomeAway(teamName="India",file="indiaOD.csv",matchType="ODI") plotTimelineofWinsLosses("indiaOD.csv",teamName="India", startDate="2015-01-01",endDate="2019-01-01", matchType="ODI") ## End(Not run)
## Not run: #Get the team data for India for Tests df <- getTeamDataHomeAway(teamName="India",file="indiaOD.csv",matchType="ODI") plotTimelineofWinsLosses("indiaOD.csv",teamName="India", startDate="2015-01-01",endDate="2019-01-01", matchType="ODI") ## End(Not run)
This function computes and plots the relative cumulative average runs of batsmen
relativeBatsmanCumulativeAvgRuns(frames, names)
relativeBatsmanCumulativeAvgRuns(frames, names)
frames |
This is a list of <batsman>.csv files obtained with an initial getPlayerData() |
names |
A list of batsmen names who need to be compared |
None
Maintainer: Tinniam V Ganesh [email protected]
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
relativeBatsmanCumulativeStrikeRate
relativeBowlerCumulativeAvgEconRate
relativeBowlerCumulativeAvgWickets
## Not run: # Retrieve the file path of a data file installed with cricketr tendulkar <- system.file("data", "tendulkar.csv", package = "cricketr") ganguly <- system.file("data", "ganguly.csv", package = "cricketr") batsmen <- list(tendulkar,ganguly) names <- list("Tendulkar","Ganguly") relativeBatsmanCumulativeAvgRuns(batsmen,names) ## End(Not run)
## Not run: # Retrieve the file path of a data file installed with cricketr tendulkar <- system.file("data", "tendulkar.csv", package = "cricketr") ganguly <- system.file("data", "ganguly.csv", package = "cricketr") batsmen <- list(tendulkar,ganguly) names <- list("Tendulkar","Ganguly") relativeBatsmanCumulativeAvgRuns(batsmen,names) ## End(Not run)
This function computes and plots the cumulative average strike rate of batsmen
relativeBatsmanCumulativeStrikeRate(frames, names)
relativeBatsmanCumulativeStrikeRate(frames, names)
frames |
This is a list of <batsman>.csv files obtained with an initial getPlayerData() |
names |
A list of batsmen names who need to be compared |
None
Maintainer: Tinniam V Ganesh [email protected]
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
relativeBatsmanCumulativeAvgRuns
relativeBowlerCumulativeAvgEconRate
relativeBowlerCumulativeAvgWickets
## Not run: # Retrieve the file path of a data file installed with cricketr tendulkar <- system.file("data", "tendulkar.csv", package = "cricketr") ganguly <- system.file("data", "ganguly.csv", package = "cricketr") batsmen <- list(tendulkar,ganguly) names <- list("Tendulkar","Ganguly") relativeBatsmanCumulativeStrikeRate(batsmen,names) ## End(Not run)
## Not run: # Retrieve the file path of a data file installed with cricketr tendulkar <- system.file("data", "tendulkar.csv", package = "cricketr") ganguly <- system.file("data", "ganguly.csv", package = "cricketr") batsmen <- list(tendulkar,ganguly) names <- list("Tendulkar","Ganguly") relativeBatsmanCumulativeStrikeRate(batsmen,names) ## End(Not run)
Calculate and plot the relative MEan Strike Rate (SR) for each batsman
relativeBatsmanSR(frames, names)
relativeBatsmanSR(frames, names)
frames |
This is a list of <batsman>.csv files obtained with an initial getPlayerData() |
names |
A list of batsmen names who need to be compared |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
batsmanDismissals
,
batsmanMovingAverage
,
batsmanPerfBoxHist
## Not run: # Get the list of the <batsman>.csv files obtained with getPlayerData() for batsmen to be compared # tendulkar <- getPlayerData(35320,file="tendulkar.csv", #type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr tendulkar <- system.file("data", "tendulkar.csv", package = "cricketr") ganguly <- system.file("data", "ganguly.csv", package = "cricketr") batsmen <- list(tendulkar,ganguly) names <- list("Tendulkar","Ganguly") relativeBatsmanSR(batsmen,names) #Note: This example uses the /data directory for the files. However #you can use any directory as long as the data files exists in that directory. ## End(Not run)
## Not run: # Get the list of the <batsman>.csv files obtained with getPlayerData() for batsmen to be compared # tendulkar <- getPlayerData(35320,file="tendulkar.csv", #type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr tendulkar <- system.file("data", "tendulkar.csv", package = "cricketr") ganguly <- system.file("data", "ganguly.csv", package = "cricketr") batsmen <- list(tendulkar,ganguly) names <- list("Tendulkar","Ganguly") relativeBatsmanSR(batsmen,names) #Note: This example uses the /data directory for the files. However #you can use any directory as long as the data files exists in that directory. ## End(Not run)
Calculate and plot the relative MEan Strike Rate (SR) for each batsman for ODI or Twenty20 batsmen
relativeBatsmanSRODTT(frames, names)
relativeBatsmanSRODTT(frames, names)
frames |
This is a list of <batsman>.csv files obtained with an initial getPlayerDataOD() or getPlayerTT() |
names |
A list of batsmen names who need to be compared |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
batsmanScoringRateODTT
relativeRunsFreqPerfODTT
batsmanPerfBoxHist
## Not run: # Get or use the <batsman>.csv obtained with getPlayerDataOD() or getPlayerTT() #sehwag <-getPlayerData(35263,dir="./mytest", file="sehwag.csv", #type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr sehwag <- system.file("data", "sehwag.csv", package = "cricketr") devilliers <- system.file("data", "devilliers.csv", package = "cricketr") gayle <- system.file("data", "gayle.csv", package = "cricketr") maxwell <- system.file("data", "maxwell.csv", package = "cricketr") batsmen <- list(sehwag,devilliers,gayle,maxwell) names <- list("Sehwag","Devilliers","Gayle","Maxwell") relativeBatsmanSRODTT(batsmen,names) # Note: This example uses the /data directory for the files. However # you can use any directory as long as the data files exists in that directory. ## End(Not run)
## Not run: # Get or use the <batsman>.csv obtained with getPlayerDataOD() or getPlayerTT() #sehwag <-getPlayerData(35263,dir="./mytest", file="sehwag.csv", #type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr sehwag <- system.file("data", "sehwag.csv", package = "cricketr") devilliers <- system.file("data", "devilliers.csv", package = "cricketr") gayle <- system.file("data", "gayle.csv", package = "cricketr") maxwell <- system.file("data", "maxwell.csv", package = "cricketr") batsmen <- list(sehwag,devilliers,gayle,maxwell) names <- list("Sehwag","Devilliers","Gayle","Maxwell") relativeBatsmanSRODTT(batsmen,names) # Note: This example uses the /data directory for the files. However # you can use any directory as long as the data files exists in that directory. ## End(Not run)
This function computes and plots the relative cumulative average economy rate of bowlers
relativeBowlerCumulativeAvgEconRate(frames, names)
relativeBowlerCumulativeAvgEconRate(frames, names)
frames |
This is a list of <bowler>.csv files obtained with an initial getPlayerData() |
names |
A list of Twenty20 bowlers names who need to be compared |
None
Maintainer: Tinniam V Ganesh [email protected]
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
relativeBatsmanCumulativeAvgRuns
relativeBowlerCumulativeAvgWickets
relativeBatsmanCumulativeStrikeRate
## Not run: # Retrieve the file path of a data file installed with cricketr kumble <- system.file("data", "kumble.csv", package = "cricketr") warne <- system.file("data", "warne.csv", package = "cricketr") murali <- system.file("data", "murali.csv", package = "cricketr") frames <- list(kumble,warne,murali) names <- c("Kumble","Warne","Murali") relativeBowlerCumulativeAvgEconRate(frames,names) ## End(Not run)
## Not run: # Retrieve the file path of a data file installed with cricketr kumble <- system.file("data", "kumble.csv", package = "cricketr") warne <- system.file("data", "warne.csv", package = "cricketr") murali <- system.file("data", "murali.csv", package = "cricketr") frames <- list(kumble,warne,murali) names <- c("Kumble","Warne","Murali") relativeBowlerCumulativeAvgEconRate(frames,names) ## End(Not run)
This function computes and plots the relative cumulative average wickets of a bowler
relativeBowlerCumulativeAvgWickets(frames, names)
relativeBowlerCumulativeAvgWickets(frames, names)
frames |
This is a list of <bowler>.csv files obtained with an initial getPlayerData() |
names |
A list of Twenty20 bowlers names who need to be compared |
None
Maintainer: Tinniam V Ganesh [email protected]
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
relativeBatsmanCumulativeAvgRuns
relativeBowlerCumulativeAvgEconRate
relativeBatsmanCumulativeStrikeRate
## Not run: ) # Retrieve the file path of a data file installed with cricketr kumble <- system.file("data", "kumble.csv", package = "cricketr") warne <- system.file("data", "warne.csv", package = "cricketr") murali <- system.file("data", "murali.csv", package = "cricketr") frames <- list(kumble,warne,murali) names <- c("Kumble","Warne","Murali") relativeBowlerCumulativeAvgWickets(frames,names) ## End(Not run)
## Not run: ) # Retrieve the file path of a data file installed with cricketr kumble <- system.file("data", "kumble.csv", package = "cricketr") warne <- system.file("data", "warne.csv", package = "cricketr") murali <- system.file("data", "murali.csv", package = "cricketr") frames <- list(kumble,warne,murali) names <- c("Kumble","Warne","Murali") relativeBowlerCumulativeAvgWickets(frames,names) ## End(Not run)
This function computes and plots the relative Economy Rate of the bowlers
relativeBowlingER(frames, names)
relativeBowlingER(frames, names)
frames |
This is a list of <bowler>.csv files obtained with an initial getPlayerData() |
names |
A list of Twenty20 bowlers names who need to be compared |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
bowlerWktsFreqPercent
relativeBowlingPerf
bowlerHistWickets
## Not run: # Get the list of the <batsman>.csv files obtained with getPlayerData() for batsmen to be compared # kumble <- getPlayerData(30176,file="kumble.csv",type="bowling", # homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr kumble <- system.file("data", "kumble.csv", package = "cricketr") warne <- system.file("data", "warne.csv", package = "cricketr") murali <- system.file("data", "murali.csv", package = "cricketr") frames <- list(kumble,warne,murali) names <- c("Kumble","Warne","Murali") relativeBowlingER(frames,names) # Note: This example uses the /data directory for the files. However # you can use any directory as long as the data files exists in that directory. ## End(Not run)
## Not run: # Get the list of the <batsman>.csv files obtained with getPlayerData() for batsmen to be compared # kumble <- getPlayerData(30176,file="kumble.csv",type="bowling", # homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr kumble <- system.file("data", "kumble.csv", package = "cricketr") warne <- system.file("data", "warne.csv", package = "cricketr") murali <- system.file("data", "murali.csv", package = "cricketr") frames <- list(kumble,warne,murali) names <- c("Kumble","Warne","Murali") relativeBowlingER(frames,names) # Note: This example uses the /data directory for the files. However # you can use any directory as long as the data files exists in that directory. ## End(Not run)
This function computes and plots the relative Economy Rate of the bowlers for ODI or Twenty20
relativeBowlingERODTT(frames, names)
relativeBowlingERODTT(frames, names)
frames |
This is a list of <bowler>.csv files obtained with an initial getPlayerDataOD() or getPlayerTT() |
names |
A list of bowlers names who need to be compared |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
relativeBatsmanSRODTT
relativeRunsFreqPerfODTT
## Not run: # Get or use the <bowler>.csv obtained with getPlayerData() # a <- getPlayerData(47492,file="steyn.csv",type="bowling", # homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr steyn <- system.file("data", "steyn.csv", package = "cricketr") mitchell <- system.file("data", "mitchell.csv", package = "cricketr") southee <- system.file("data", "southee.csv", package = "cricketr") malinga <- system.file("data", "malinga.csv", package = "cricketr") frames <- list(steyn,mitchell,southee,malinga) names <- c("Steyn","Mitchell","Southee","Malinga") relativeBowlingERODTT(frames,names) # Note: This example uses the /data directory for the files. However # you can use any directory as long as the data files exists in that directory. ## End(Not run)
## Not run: # Get or use the <bowler>.csv obtained with getPlayerData() # a <- getPlayerData(47492,file="steyn.csv",type="bowling", # homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr steyn <- system.file("data", "steyn.csv", package = "cricketr") mitchell <- system.file("data", "mitchell.csv", package = "cricketr") southee <- system.file("data", "southee.csv", package = "cricketr") malinga <- system.file("data", "malinga.csv", package = "cricketr") frames <- list(steyn,mitchell,southee,malinga) names <- c("Steyn","Mitchell","Southee","Malinga") relativeBowlingERODTT(frames,names) # Note: This example uses the /data directory for the files. However # you can use any directory as long as the data files exists in that directory. ## End(Not run)
This function calculates and plots the relative performance of the suers
relativeBowlingPerf(frames, names)
relativeBowlingPerf(frames, names)
frames |
This is a list of <bowler>.csv files obtained with an initial getPlayerData() |
names |
A list of bowlers names who need to be compared |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
bowlerWktsFreqPercent
relativeBowlingER
bowlerHistWickets
## Not run: # Get the list of the <batsman>.csv files obtained with getPlayerData() for batsmen to be compared # kumble <- getPlayerData(30176,file="kumble.csv",type="bowling", # homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr kumble <- system.file("data", "kumble.csv", package = "cricketr") warne <- system.file("data", "warne.csv", package = "cricketr") murali <- system.file("data", "murali.csv", package = "cricketr") frames <- list(kumble,warne,murali) names <- c("Kumble","Warne","Murali") relativeBowlingPerf(frames,names) # Note: This example uses the /data directory for the files. However # you can use any directory as long as the data files exists in that directory. ## End(Not run)
## Not run: # Get the list of the <batsman>.csv files obtained with getPlayerData() for batsmen to be compared # kumble <- getPlayerData(30176,file="kumble.csv",type="bowling", # homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr kumble <- system.file("data", "kumble.csv", package = "cricketr") warne <- system.file("data", "warne.csv", package = "cricketr") murali <- system.file("data", "murali.csv", package = "cricketr") frames <- list(kumble,warne,murali) names <- c("Kumble","Warne","Murali") relativeBowlingPerf(frames,names) # Note: This example uses the /data directory for the files. However # you can use any directory as long as the data files exists in that directory. ## End(Not run)
This function computes the run frequencies in ranges of 10 and plots these for a list of batsmen
relativeRunsFreqPerf(frames, names)
relativeRunsFreqPerf(frames, names)
frames |
This is a list of <batsman>.csv files obtained with an initial getPlayerData() |
names |
A list of batsmen names who need to be compared |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
batsmanDismissals
,
batsmanMovingAverage
,
batsmanPerfBoxHist
## Not run: # Get the list of the <batsman>.csv files obtained with getPlayerData() for batsmen to be compared # tendulkar <- getPlayerData(35320,file="tendulkar.csv",type="batting", # homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr tendulkar <- system.file("data", "tendulkar.csv", package = "cricketr") ganguly <- system.file("data", "ganguly.csv", package = "cricketr") batsmen <- list(tendulkar,ganguly) names <- list("Tendulkar","Ganguly") relativeRunsFreqPerf(batsmen,names) # Note: This example uses the /data directory for the files. However # you can use any directory as long as the data files exists in that directory. ## End(Not run)
## Not run: # Get the list of the <batsman>.csv files obtained with getPlayerData() for batsmen to be compared # tendulkar <- getPlayerData(35320,file="tendulkar.csv",type="batting", # homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr tendulkar <- system.file("data", "tendulkar.csv", package = "cricketr") ganguly <- system.file("data", "ganguly.csv", package = "cricketr") batsmen <- list(tendulkar,ganguly) names <- list("Tendulkar","Ganguly") relativeRunsFreqPerf(batsmen,names) # Note: This example uses the /data directory for the files. However # you can use any directory as long as the data files exists in that directory. ## End(Not run)
This function computes the run frequencies in ranges of 10 and plots these for a list of batsmen
relativeRunsFreqPerfODTT(frames, names)
relativeRunsFreqPerfODTT(frames, names)
frames |
This is a list of <batsman>.csv files obtained with an initial getPlayerDataOD() or getPlayerTT() |
names |
A list of batsmen names who need to be compared |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
batsmanScoringRateODTT
,
relativeRunsFreqPerfODTT
,
batsmanPerfBoxHist
## Not run: # Get or use the <batsman>.csv obtained with getPlayerDataOD() or getPlayerTT() #sehwag <-getPlayerData(35263,dir="./mytest", file="sehwag.csv", #type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr sehwag <- system.file("data", "sehwag.csv", package = "cricketr") devilliers <- system.file("data", "devilliers.csv", package = "cricketr") gayle <- system.file("data", "gayle.csv", package = "cricketr") maxwell <- system.file("data", "maxwell.csv", package = "cricketr") batsmen <- list(sehwag,devilliers,gayle,maxwell) names <- list("Sehwag","Devilliers","Gayle","Maxwell") relativeRunsFreqPerfODTT(batsmen,names) # Note: This example uses the /data directory for the files. However # you can use any directory as long as the data files exists in that directory. ## End(Not run)
## Not run: # Get or use the <batsman>.csv obtained with getPlayerDataOD() or getPlayerTT() #sehwag <-getPlayerData(35263,dir="./mytest", file="sehwag.csv", #type="batting", homeOrAway=c(1,2),result=c(1,2,4)) # Retrieve the file path of a data file installed with cricketr sehwag <- system.file("data", "sehwag.csv", package = "cricketr") devilliers <- system.file("data", "devilliers.csv", package = "cricketr") gayle <- system.file("data", "gayle.csv", package = "cricketr") maxwell <- system.file("data", "maxwell.csv", package = "cricketr") batsmen <- list(sehwag,devilliers,gayle,maxwell) names <- list("Sehwag","Devilliers","Gayle","Maxwell") relativeRunsFreqPerfODTT(batsmen,names) # Note: This example uses the /data directory for the files. However # you can use any directory as long as the data files exists in that directory. ## End(Not run)
This function computes and plots the relative Wicket Rate of the bowlers in Twenty20 International
relativeWktRateTT(frames, names)
relativeWktRateTT(frames, names)
frames |
This is a list of Twenty20 <bowler>.csv files obtained with an initial getPlayerDataTT() |
names |
A list of bowlers names who need to be compared |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
bowlerWktsFreqPercent
relativeBowlingPerf
bowlerHistWickets
bowlerWktRateTT
## Not run: # Get or use the <bowler>.csv obtained with getPlayerData() # a <- getPlayerDataTT(26421,dir=".",file="ashwin.csv",type="bowling", # homeOrAway=c(1,2,3), result=c(1,2,3,5)) # Retrieve the file path of a data file installed with cricketr mendis <- system.file("data", "mendis.csv", package = "cricketr") narine <- system.file("data", "narine.csv", package = "cricketr") badree <- system.file("data", "badree.csv", package = "cricketr") frames <- list(mendis, badree,narine) names <- c("Mendis","Badree","Narine") relativeWktRateTT(frames,names) #Note: This example uses the /data directory for the files. However #you can use any directory as long as the data files exists in that directory. ## End(Not run)
## Not run: # Get or use the <bowler>.csv obtained with getPlayerData() # a <- getPlayerDataTT(26421,dir=".",file="ashwin.csv",type="bowling", # homeOrAway=c(1,2,3), result=c(1,2,3,5)) # Retrieve the file path of a data file installed with cricketr mendis <- system.file("data", "mendis.csv", package = "cricketr") narine <- system.file("data", "narine.csv", package = "cricketr") badree <- system.file("data", "badree.csv", package = "cricketr") frames <- list(mendis, badree,narine) names <- c("Mendis","Badree","Narine") relativeWktRateTT(frames,names) #Note: This example uses the /data directory for the files. However #you can use any directory as long as the data files exists in that directory. ## End(Not run)
Data set for Virendar Sehwag
data("sehwag")
data("sehwag")
The format is: chr "sehwag"
Data set for Virendar Sehwag
https://www.espncricinfo.com/ci/content/stats/index.html
https://www.espncricinfo.com/ci/content/stats/index.html
Data set for Virendar Sehwag
data("sehwag1")
data("sehwag1")
The format is: chr "sehwag1"
Data set for Virendar Sehwag
https://www.espncricinfo.com/ci/content/stats/index.html
https://www.espncricinfo.com/ci/content/stats/index.html
Data set for Virendar Sehwag
data("sehwag2")
data("sehwag2")
The format is: chr "sehwag2"
Data set for Virendar Sehwag
https://www.espncricinfo.com/ci/content/stats/index.html
https://www.espncricinfo.com/ci/content/stats/index.html
Data set for Tim Southee
data("southee")
data("southee")
The format is: chr "southee"
Data set for Tin Southee
https://www.espncricinfo.com/ci/content/stats/index.html
https://www.espncricinfo.com/ci/content/stats/index.html
Data set for Dale Steyn
data("steyn")
data("steyn")
The format is: chr "steyn"
Data set for Dale Steyn
https://www.espncricinfo.com/ci/content/stats/index.html
https://www.espncricinfo.com/ci/content/stats/index.html
This function computes the won,lost,draw,tied or no result for a team against other teams in home/away or neutral venues and either returns a dataframe or plots it for grounds
teamWinLossStatusAtGrounds(file,teamName,opposition=c("all"),homeOrAway=c("all"), matchType="Test",plot=FALSE)
teamWinLossStatusAtGrounds(file,teamName,opposition=c("all"),homeOrAway=c("all"), matchType="Test",plot=FALSE)
file |
The CSV file for which the plot is required |
teamName |
The name of the team for which plot is required |
opposition |
Opposition is a vector namely c("all") or c("Australia", "India", "England") |
homeOrAway |
This parameter is a vector which is either c("all") or a vector of venues c("home","away","neutral") |
matchType |
Match type - Test, ODI or T20 |
plot |
If plot=FALSE then a data frame is returned, If plot=TRUE then a plot is generated |
None
Maintainer: Tinniam V Ganesh [email protected]
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
teamWinLossStatusVsOpposition
teamWinLossStatusAtGrounds
plotTimelineofWinsLosses
## Not run: #Get the team data for India for Tests df <- getTeamDataHomeAway(teamName="India",file="indiaOD.csv",matchType="ODI") teamWinLossStatusAtGrounds("india.csv",teamName="India",opposition=c("Australia","England","India"), homeOrAway=c("home","away"),plot=TRUE) ## End(Not run)
## Not run: #Get the team data for India for Tests df <- getTeamDataHomeAway(teamName="India",file="indiaOD.csv",matchType="ODI") teamWinLossStatusAtGrounds("india.csv",teamName="India",opposition=c("Australia","England","India"), homeOrAway=c("home","away"),plot=TRUE) ## End(Not run)
This function computes the won,lost,draw,tied or no result for a team against other teams in home/away or neutral venues and either returns a dataframe or plots it against opposition
teamWinLossStatusVsOpposition(file,teamName,opposition=c("all"),homeOrAway=c("all"), matchType="Test",plot=FALSE)
teamWinLossStatusVsOpposition(file,teamName,opposition=c("all"),homeOrAway=c("all"), matchType="Test",plot=FALSE)
file |
The CSV file for which the plot is required |
teamName |
The name of the team for which plot is required |
opposition |
Opposition is a vector namely c("all") or c("Australia", "India", "England") |
homeOrAway |
This parameter is a vector which is either c("all") or a vector of venues c("home","away","neutral") |
matchType |
Match type - Test, ODI or T20 |
plot |
If plot=FALSE then a data frame is returned, If plot=TRUE then a plot is generated |
None
Maintainer: Tinniam V Ganesh [email protected]
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
teamWinLossStatusVsOpposition
teamWinLossStatusAtGrounds
plotTimelineofWinsLosses
## Not run: #Get the team data for India for Tests df <- getTeamDataHomeAway(teamName="India",file="indiaOD.csv",matchType="ODI") teamWinLossStatusAtGrounds("india.csv",teamName="India",opposition=c("Australia","England","India"), homeOrAway=c("home","away"),plot=TRUE) ## End(Not run)
## Not run: #Get the team data for India for Tests df <- getTeamDataHomeAway(teamName="India",file="indiaOD.csv",matchType="ODI") teamWinLossStatusAtGrounds("india.csv",teamName="India",opposition=c("Australia","England","India"), homeOrAway=c("home","away"),plot=TRUE) ## End(Not run)
Data set for Sachin Tendulkar
data("tendulkar")
data("tendulkar")
The format is: chr "tendulkar"
Data set for Sachin Tendulkar
https://www.espncricinfo.com/ci/content/stats/index.html
https://www.espncricinfo.com/ci/content/stats/index.html
Data set for Sachin Tendulkar
data("tendulkar1")
data("tendulkar1")
The format is: chr "tendulkar1"
Data set for Sachin Tendulkar
https://www.espncricinfo.com/ci/content/stats/index.html
https://www.espncricinfo.com/ci/content/stats/index.html
Data set for Sachin Tendulkar
data("tendulkar2")
data("tendulkar2")
The format is: chr "tendulkar2"
Data set for Sachin Tendulkar
https://www.espncricinfo.com/ci/content/stats/index.html
https://www.espncricinfo.com/ci/content/stats/index.html
Data set for Sachin Tendulkar
data("tendulkarsp")
data("tendulkarsp")
The format is: chr "tendulkarsp"
Data set for Sachin Tendulkar
https://www.espncricinfo.com/ci/content/stats/index.html
https://www.espncricinfo.com/ci/content/stats/index.html
Data set for Shane Warne
data("warne")
data("warne")
The format is: chr "warne"
Data set for Shane Warne
https://www.espncricinfo.com/ci/content/stats/index.html
https://www.espncricinfo.com/ci/content/stats/index.html
This function caculates the wicket rate vs mean number of deliveries
WR(file)
WR(file)
file |
Name of file |
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
None
Maintainer: Tinniam V Ganesh <[email protected]>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
##---- Should be DIRECTLY executable !! ---- ##-- ==> Define data, use random, ##-- or do help(data=index) for the standard data sets. ## The function is currently defined as function (file) { bowler <- clean(file) wktRate <- NULL w <- NULL for (i in 0:max(as.numeric(as.character(bowler$Wkts)))) { balls <- bowler[bowler$Wkts == i, ]$Overs * 6 if (length(balls != 0)) { wktRate[i] <- lapply(list(balls), mean) w[i] <- i } } a <- sapply(wktRate, is.null) wktRate[a] <- NaN wktRate }
##---- Should be DIRECTLY executable !! ---- ##-- ==> Define data, use random, ##-- or do help(data=index) for the standard data sets. ## The function is currently defined as function (file) { bowler <- clean(file) wktRate <- NULL w <- NULL for (i in 0:max(as.numeric(as.character(bowler$Wkts)))) { balls <- bowler[bowler$Wkts == i, ]$Overs * 6 if (length(balls != 0)) { wktRate[i] <- lapply(list(balls), mean) w[i] <- i } } a <- sapply(wktRate, is.null) wktRate[a] <- NaN wktRate }