robjhyndman / cricketdata

International cricket data for men and women, Tests, ODIs and T20s
http://pkg.robjhyndman.com/cricketdata/
80 stars 21 forks source link

New Competition SA20 in fetch_cricsheet #29

Closed Dazzalytics closed 1 year ago

Dazzalytics commented 1 year ago

Could you please add SA20 to the competition list for fetch_cricsheet? Thank you!

fetch_cricsheet( type = c("bbb", "match", "player"), gender = c("female", "male"), competition = c("tests", "multi_day", "odis", "odms", "t20is", "t20is_unofficial", "apl", "bbl", "bpl", "county", "edwards_cup", "cpl", "the_hundred", "ipl", "lpl", "msl", "t20_blast", "psl", "heyhoe_flint_trophy", "sheffield_shield", "super_smash", "wbbl", "wt20c") )

robjhyndman commented 1 year ago

There are now so many cricsheet competition options, I think it would be better to require the user to specify the corresponding three or four letter acronym. Otherwise this will need to be constantly updated. The only issue is that it would require the user to figure out the acronym. What do you think?

Dazzalytics commented 1 year ago

It seems the convenient option is to direct the user to the CSV download page of the cricsheet to get the league acronym by clicking on the Original/New CSV format data and looking at the first three letters of the file name that pops up to be downloaded. Some are easier to pick up, like PSL for Pakistan Super League or IPL for Indian Premier League. But then the cricsheet is calling SA20 as SAT.

I wonder if there's a way to scrape those names and store them in a df.

robjhyndman commented 1 year ago

Done in https://github.com/robjhyndman/cricketdata/commit/f2a0eca3742fe27e9d6633eba1835c795c7a9e99

Dazzalytics commented 1 year ago

Great work!

It seems the cleaning function, we wrote for T20 bbb data, might not be getting applied to the new league's data. E.g., I accessed the new SA20 bb data through our package, and it doesn't have the extra features that we added in the cleaning function. Please have a look at your convenience. Thank you!

robjhyndman commented 1 year ago

Fixed in https://github.com/robjhyndman/cricketdata/commit/7bb1654cc69748257a2ee44e287c7bed2ca03ab9.