#Adding home goals per team per season B <- FullEPL %>% group_by(Seasons,HomeTeam) %>% mutate(Home_goals = sum(FTHG)) #adding away goals per team per season C <- B %>% group_by(Seasons,AwayTeam) %>% mutate(Away_goals = sum(FTAG)) #I can keep adding the colums i need from the previous tables made Test <- aggregate (x= FullEPL$FTAG, by= list(FullEPL$AwayTeam), by= list(FullEPL$Seasons), FUN=sum)