library(rFootballAnalysis) library(tidyverse) library(mapdata) Ttt = DL_Matches(c("NLD1","ESP1"),"2016-2017","2016-2017") Tt = ST_Ranking(Ttt)
\pagebreak
nLeagues = unique(Tt[,c("Div","Season")]) %>% arrange(Div,Season) for (i in 1:nrow(nLeagues)){ # Determine some filters: div.i = nLeagues$Div[i] season.i = nLeagues$Season[i] # Determine the data frames: Tt.season = Tt %>% filter(Div==div.i,Season==season.i) %>% dplyr::select(Rank,Team:GD) cat('\n') titleRanking = paste0("##Season ranking for ",div.i," season ",season.i) cat(titleRanking) print(knitr::kable(Tt.season)) cat('\n') print(ggplot(Tt.season,aes(reorder(Team,-Rank),Pts)) + geom_bar(stat="identity") + # geom_text(aes(label=Pts)) + coord_flip() + theme_minimal() + labs(x = "Team",y = "Points")) cat("\n\\pagebreak\n") }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.