getPlayerDataSp: Get the player data along with venue and

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

View source: R/getPlayerDataSp.R

Description

This function is a specialized version of getPlayer Data. This function gets the players data along with details on matches' venue (home/abroad) and the result of match(won,lost,drawn) as 2 separate columns (ha & result). The column ha has 1:home and 2: overseas. The column result has values 1:won , 2;lost and :drawn match

Usage

1
2
getPlayerDataSp(profileNo, tdir = "./data", tfile = "player001.csv", 
ttype = "batting")

Arguments

profileNo

This is the profile number of the player to get data. This can be obtained from https://www.espncricinfo.com/ci/content/player/index.html. Type the name of the player and click search. This will display the details of the player. Make a note of the profile ID. For e.g For Sachin Tendulkar this turns out to be https://www.espncricinfo.com/india/content/player/35320.html. Hence the profile for Sachin is 35320

tdir

Name of the directory to store the player data into. If not specified the data is stored in a default directory "./data". Default="./tdata"

tfile

Name of the file to store the data into for e.g. tendulkar.csv. This can be used for subsequent functions. Default="player001.csv"

ttype

type of data required. This can be "batting" or "bowling"

Details

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

Value

Returns the player's dataframe along with the homeAway and the result columns

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

getPlayerData

Examples

1
2
3
4
5
6
7
8
## Not run: 
# Only away. Get data only for won and lost innings
tendulkar <-getPlayerDataSp(35320,tdir="../cricketr/data", tfile="tendulkarsp.csv",ttype="batting")

# Get bowling data and store in file for future
kumble <- getPlayerDataSp(30176,tdir="../cricketr/data",tfile="kumblesp.csv",ttype="bowling")

## End(Not run)

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