cleanBowlerData: Clean the bowlers data frame

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

View source: R/cleanBowlerData.R

Description

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

Usage

1

Arguments

file

The <bowler>.csv file

Details

More details can be found in my short video tutorial in Youtube https://www.youtube.com/watch?v=q9uMPFVsXsI

Value

A cleaned bowler data frame with complete cases

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/

See Also

clean

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## 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)

Example output

    X Overs Mdns Runs Wkts Econ Pos Inns     Opposition    Ground  Start.Date
1   1  29.0    8   50    3 1.72   3    2      v England   Kolkata 29 Jan 1993
2   2  40.0   16   76    3 1.90   3    3      v England   Kolkata 29 Jan 1993
3   3  25.0    9   61    2 2.44   2    2      v England   Chennai 11 Feb 1993
4   4  21.0    7   64    6 3.04   5    3      v England   Chennai 11 Feb 1993
5   5  40.0    4   95    3 2.37   4    1      v England    Mumbai 19 Feb 1993
6   6  26.0    9   70    4 2.69   3    3      v England    Mumbai 19 Feb 1993
7   7  43.0   12   90    3 2.09   4    2     v Zimbabwe     Delhi 13 Mar 1993
8   8  38.5   16   70    5 1.80   4    3     v Zimbabwe     Delhi 13 Mar 1993
9   9  37.0   10   69    4 1.86   4    2    v Sri Lanka   Lucknow 18 Jan 1994
10 10  27.3    9   59    7 2.14   4    3    v Sri Lanka   Lucknow 18 Jan 1994
11 11  13.0    2   50    3 3.84   3    2    v Sri Lanka Bangalore 26 Jan 1994
12 12  16.0    3   64    3 4.00   3    3    v Sri Lanka Bangalore 26 Jan 1994
13 13  15.0    3   30    1 2.00   3    1    v Sri Lanka Ahmedabad  8 Feb 1994
14 14  28.0    9   45    0 1.60   4    3    v Sri Lanka Ahmedabad  8 Feb 1994
15 15  23.5    7   48    3 2.01   3    2  v West Indies    Mumbai 18 Nov 1994
16 16  12.0    1   39    0 3.25   4    4  v West Indies    Mumbai 18 Nov 1994
17 17  29.0    3   90    4 3.10   5    1  v West Indies    Mohali 10 Dec 1994
18 18   7.0    0   56    0 8.00   3    3  v West Indies    Mohali 10 Dec 1994
19 19  18.0    5   39    4 2.16   4    1  v New Zealand Bangalore 18 Oct 1995
20 20  27.2    4   81    5 2.96   3    3  v New Zealand Bangalore 18 Oct 1995
21 21  24.0    7   63    4 2.62   4    1    v Australia     Delhi 10 Oct 1996
22 22  41.0   12   67    5 1.63   3    3    v Australia     Delhi 10 Oct 1996
23 23  31.0    6   76    2 2.45   3    2 v South Africa Ahmedabad 20 Nov 1996
24 24  12.0    2   34    3 2.83   3    4 v South Africa Ahmedabad 20 Nov 1996
25 25  20.1    1   78    2 3.86   5    1 v South Africa   Kolkata 27 Nov 1996
26 26  32.0    4  101    1 3.15   3    3 v South Africa   Kolkata 27 Nov 1996
27 27  27.0    2   71    4 2.62   3    2 v South Africa    Kanpur  8 Dec 1996
28 28  24.0   11   27    1 1.12   3    4 v South Africa    Kanpur  8 Dec 1996
29 29  45.0   10  103    4 2.28   3    2    v Australia   Chennai  6 Mar 1998
30 30  22.5    7   46    4 2.01   4    4    v Australia   Chennai  6 Mar 1998
31 31  28.0   11   44    3 1.57   3    1    v Australia   Kolkata 18 Mar 1998
32 32  31.0   10   62    5 2.00   3    3    v Australia   Kolkata 18 Mar 1998
33 33  41.3    8   98    6 2.36   3    2    v Australia Bangalore 25 Mar 1998
34 34  22.4    5   63    1 2.77   2    4    v Australia Bangalore 25 Mar 1998
35 35  24.5    7   70    6 2.81   3    1     v Pakistan   Chennai 28 Jan 1999
36 36  22.0    4   93    1 4.22   3    3     v Pakistan   Chennai 28 Jan 1999
37 37  24.3    4   75    4 3.06   4    2     v Pakistan     Delhi  4 Feb 1999
38 38  26.3    9   74   10 2.79   3    4     v Pakistan     Delhi  4 Feb 1999
39 39  19.2    8   48    1 2.48   4    1     v Pakistan   Kolkata 16 Feb 1999
40 40  27.0    4   91    0 3.37   3    3     v Pakistan   Kolkata 16 Feb 1999
41 41  32.5   12   67    4 2.04   3    1  v New Zealand    Kanpur 22 Oct 1999
42 42  26.5    5   67    6 2.49   3    3  v New Zealand    Kanpur 22 Oct 1999
43 43  22.0    1   62    2 2.81   3    2 v South Africa    Mumbai 24 Feb 2000
44 44  28.0   12   56    4 2.00   3    4 v South Africa    Mumbai 24 Feb 2000
45 45  68.4   15  143    6 2.08   2    2 v South Africa Bangalore  2 Mar 2000
46 46  19.0    6   52    2 2.73   4    1      v England    Mohali  3 Dec 2001
47 47  28.4    6   81    6 2.82   3    3      v England    Mohali  3 Dec 2001
48 48  33.5   12   82    4 2.42   4    1     v Zimbabwe    Nagpur 21 Feb 2002
49 49  37.0   15   63    5 1.70   2    3     v Zimbabwe    Nagpur 21 Feb 2002
50 50  34.0   13   88    3 2.58   4    1     v Zimbabwe     Delhi 28 Feb 2002
51 51  29.3    8   58    4 1.96   4    3     v Zimbabwe     Delhi 28 Feb 2002
52 52  24.5    5   51    4 2.05   4    2  v West Indies    Mumbai  9 Oct 2002
53 53  25.0    8   50    3 2.00   5    3  v West Indies    Mumbai  9 Oct 2002
54 54  23.3   10   30    5 1.27   5    1  v West Indies   Chennai 17 Oct 2002
55 55  26.0    3   87    1 3.34   4    3  v West Indies   Chennai 17 Oct 2002
56 56  39.0    4  157    3 4.02   4    1    v Australia Bangalore  6 Oct 2004
57 57  23.0    4   64    2 2.78   4    3    v Australia Bangalore  6 Oct 2004
58 58  25.0    6   99    2 3.96   3    1    v Australia    Nagpur 26 Oct 2004
59 59  21.0    1   89    1 4.23   3    3    v Australia    Nagpur 26 Oct 2004
60 60  19.0    0   90    5 4.73   3    2    v Australia    Mumbai  3 Nov 2004
61 61   6.0    3    5    1 0.83   4    4    v Australia    Mumbai  3 Nov 2004
62 62  30.0    6   76    1 2.53   3    1 v South Africa   Kolkata 28 Nov 2004
63 63  34.4    7   82    3 2.36   3    3 v South Africa   Kolkata 28 Nov 2004
64 64  37.1   11   98    3 2.63   3    2     v Pakistan   Kolkata 16 Mar 2005
65 65  38.0   16   63    7 1.65   3    4     v Pakistan   Kolkata 16 Mar 2005
66 66  46.0    8  159    0 3.45   3    1     v Pakistan Bangalore 24 Mar 2005
67 67  21.0    1   88    1 4.19   3    3     v Pakistan Bangalore 24 Mar 2005
68 68  28.0    6   72    6 2.57   3    2    v Sri Lanka     Delhi 10 Dec 2005
69 69  36.0    7   85    4 2.36   3    4    v Sri Lanka     Delhi 10 Dec 2005
70 70  25.0    3   87    2 3.48   3    2    v Sri Lanka Ahmedabad 18 Dec 2005
71 71  34.3    9   89    5 2.57   4    4    v Sri Lanka Ahmedabad 18 Dec 2005
72 72  29.4    8   76    5 2.56   5    1      v England    Mohali  9 Mar 2006
73 73  29.0    7   70    4 2.41   4    3      v England    Mohali  9 Mar 2006
74 74  39.0    7   84    1 2.15   4    1      v England    Mumbai 18 Mar 2006
75 75  30.4   13   49    4 1.59   4    3      v England    Mumbai 18 Mar 2006
76 76  21.2    6   38    4 1.78   3    1     v Pakistan     Delhi 22 Nov 2007
77 77  27.1    8   68    3 2.50   3    3     v Pakistan     Delhi 22 Nov 2007
78 78  33.0    2   78    1 2.36   5    2 v South Africa Ahmedabad  3 Apr 2008

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