library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(tidyr)
library(ggplot2)
epl = read.csv("/Users/KD/OneDrive - Imperial College London/Modules/Quantitative Methods/Lecture 3/Visualisation Exercise/results.csv", header = TRUE)
epl_winstats = epl %>% select(result,season)
counts <- table(epl_winstats)
test<-data.frame(counts)
ggplot(test,aes(fill=result, x=season, y=Freq)) + geom_bar(position="dodge", stat="identity") + theme_minimal() + labs(title = "English Premier League Results (2006 - 2018)", x="Season", y="# of Wins/Draws", fill = "Win Type") + scale_fill_discrete(labels = c("Away Wins", "Draws", "Home Wins"))