WR {cricketr} | R Documentation |
This function caculates the wicket rate vs mean number of deliveries
Description
This function caculates the wicket rate vs mean number of deliveries
Usage
WR(file)
Arguments
file |
Name of file |
Details
More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI
Value
None
Note
Maintainer: Tinniam V Ganesh <tvganesh.85@gmail.com>
Author(s)
Tinniam V Ganesh
References
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
Examples
##---- 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
}
[Package cricketr version 0.0.26 Index]