This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Grouping the matches by season | |
df_season <- df %>% #%>% is a special operator which translates to 'then' in English. | |
group_by(Season) %>% | |
summarise(HomeGoals = sum(hgoal), AwayGoals = sum(vgoal), HomeWins = sum(result == 'H'), AwayWins = sum(result =='A'), Draws = sum(result == 'D')) | |
#Grouping the matches by full time scores | |
df_scoreline <- df %>% | |
group_by(FT) %>% | |
summarise(count=n()) %>% | |
arrange(desc(count)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(devtools) | |
library('dplyr') | |
install_github('engsoccerdata', username = "jalapic") | |
library(engsoccerdata) | |
data(package="engsoccerdata") | |
df = engsoccerdata2 | |
df =tbl_df(df) #Converts it to a local data frame (Better printing options than regular data frame) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
player = read.csv('Football_Player.csv') | |
Ballon <- player %>% | |
group_by(Name.of.Player) %>% | |
summarise('BallonAward' = sum(((Total.Goals+Assists)*0.5)+(0.2*((Shot.Accuracy/100)+(Pass...Percentage/100)))-((0.1))*Fouls...Committed)-((0.2)*Cards...Total)) | |
Ballon <- mvp %>% | |
arrange(desc(BallonAward)) | |
playerStat <- player %>% | |
group_by(Name.of.Player) %>% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library('dplyr') | |
football = read.csv("2013-14.csv") | |
football = tbl_df(football) | |
home <- football %>% | |
group_by(HomeTeam) %>% | |
summarise(HomeWins = sum(FTHG > FTAG), HomeDraws= sum(FTHG==FTAG), HomeLoses=sum(FTHG < FTAG), GoalDifference=sum(FTHG-FTAG), RedCards=sum(HR), TargetbyTotal=sum(HST/HS), HomeCorners=sum(HC), HomeShotonTarget = sum(HST), HomeGoals=sum(FTHG)) %>% | |
arrange(desc(HomeWins)) | |
away <- football %>% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
import urllib | |
import urllib2 | |
from instagram.client import InstagramAPI | |
INSTAGRAM_CLIENT_ID = '' | |
INSTAGRAM_CLIENT_SECRET = '' |