jalapic/engsoccerdata

Current Season Data Function for each league

jalapic opened this issue · 1 comments

england_current() gets data for the top 4 tiers of England for each season. We need a function to get current season data in the same format as each domestic league's dataframe for the following:

League Tiers
Spain 1
Germany 1,2
Holland 1
France 1
Italy 1
Turkey 1
Greece 1
Belgium 1
Portugal 1
Scotland 1,2,3,4

I am happy for england to have it's own separate function as most people use the package for that dataset and it is the most complete. However, it's probably not good to have lots of x_current() functions from a package management perspective. Therefore I'd like one function with an argument of country= to get the data.

Importantly, as this function will rely on external sources of data which might change (and often do), we will need an error catching message to return an error - this will then require the function being changed/updated - which I can foresee happening fairly regularly unfortunately.

this is complete. It was easiest to make a separate function for each league. A generic function getCurrentData was made that each country function uses to convert raw data into dataframe. When the new seasons starts, we only need to amend the Season date in that one function - not all functions. This could be automated further by using sys.Date to determine what would be the current season.

The only country not completed is MLS as this would require scraping - this website is possibly ok for this purpose: http://www.scoreboard.com/mls/results/ I'll leave it to others for now to do that.