knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
Scoreboards of the Eurovision Song Contest scraped from the official website.
Install from GitHub:
devtools::install_github("hmalmedal/eurovisionsongcontest")
Which participants have received zero points in the final the most times?
library(eurovisionsongcontest) library(dplyr) library(tidyr) library(stringr) library(lubridate) eurovisionsongcontest %>% spread(key, value) %>% select(Participant, Event, Date, Points) %>% mutate(Year = year(Date)) %>% filter(Points == 0, !str_detect(Event, "Semi")) %>% group_by(Participant) %>% summarise(n = n(), `Year(s)` = list(Year)) %>% arrange(desc(n)) %>% knitr::kable()
How often does Greece receive 12 points from Cyprus in the final?
eurovisionsongcontest %>% spread(key, value) %>% select(Participant, Event, Cyprus = ends_with("Cyprus")) %>% filter(Participant == "Greece", !str_detect(Event, "Semi"), Cyprus == 12) %>% arrange(Event) %>% knitr::kable()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.