getPlayerDataOppnHA: Return a filtered CSV file for a player against specified...

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

View source: R/getPlayerDataOppnHA.R

Description

This function saves the filtered players data as a CSV file for matches against specified opposition, at home.away venues for a specified interval

Usage

1
2
getPlayerDataOppnHA(infile,outfile,dir=".",opposition=c("all"),homeOrAway=c("all"),
                          startDate="2001-01-01",endDate="2019-01-01")

Arguments

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

Value

dataframe

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

teamWinLossStatusVsOpposition batsman4s6s

Examples

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

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