WR: This function caculates the wicket rate vs mean number of...

Description Usage Arguments Details Value Note Author(s) References Examples

View source: R/relativeWktRateTT.R

Description

This function caculates the wicket rate vs mean number of deliveries

Usage

1

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

 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
  }

cricketr documentation built on March 23, 2021, 9:06 a.m.