Description Usage Arguments Details Value Note Author(s) References Examples
View source: R/relativeWktRateTT.R
This function caculates the wicket rate vs mean number of deliveries
1 |
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 <tvganesh.85@gmail.com>
Tinniam V Ganesh
https://www.espncricinfo.com/ci/content/stats/index.html
https://gigadom.in/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ##---- 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
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.