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
## Packages | |
```{r} | |
library(rvest) | |
library(polite) # devtools::install_github("dmi3kno/polite") | |
library(dplyr) | |
library(tidyr) | |
library(ggplot2) | |
library(scales) | |
library(purrr) |
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(ggplot2) | |
library(dplyr) | |
library(tidyr) | |
library(purrr) | |
library(jsonlite) | |
library(lubridate) | |
library(magrittr) | |
library(scales) | |
library(stringr) | |
library(extrafont) |
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
original viz link: https://gist.github.com/thomasp85/c36ab5cfe387dec9d5e99a85a776bfa0 | |
# try to do above but with Japan instead! | |
library(gganimate) | |
library(cartogram) | |
library(geogrid) # devtools::install_github("jbaileyh/geogrid") >>> for sf support! | |
library(rnaturalearth) | |
library(sf) | |
library(scico) |
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
# saw these types of plots for different leagues on r/soccer | |
# (originally by Twitter: @fussbALEXperte) | |
# so thought I'd make my own version using R! | |
library(rvest) | |
library(polite) | |
library(dplyr) | |
library(tidyr) | |
library(purrr) | |
library(ggplot2) |
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
# http://www.climate-lab-book.ac.uk/2018/warming-stripes/ | |
# data from: http://www.data.jma.go.jp/obd/stats/etrn/view/annually_s.php?prec_no=44&block_no=47662 | |
library(ggimage) | |
library(ggplot2) | |
library(dplyr) | |
library(tidyr) | |
library(purrr) | |
library(scales) | |
library(rvest) |
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(polite) | |
library(rvest) | |
library(dplyr) | |
library(tidyr) | |
library(stringr) | |
library(lubridate) | |
library(ggplot2) | |
library(extrafont) | |
loadfonts() # run once per session |
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) | |
library(tidyr) | |
library(ggplot2) | |
library(cranlogs) | |
library(ggtextures) # devtools::install_github("clauswilke/ggtextures") | |
library(extrafont) | |
loadfonts() | |
# top 10 package downloads from 9/29 to 10/28 from 'cranlogs' package | |
top_10_october <- cran_top_downloads(when = "last-month", count = 10) |
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
pacman::p_load(tidyverse, scales, lubridate, ggrepel, glue, extrafont) | |
loadfonts() | |
lfc_elo_raw <- read_csv("http://api.clubelo.com/liverpool") | |
dortmund_elo_raw <- read_csv("http://api.clubelo.com/Dortmund") | |
mainz_elo_raw <- read_csv("http://api.clubelo.com/Mainz") | |
mainz_elo_clean <- mainz_elo_raw %>% | |
filter(between(From, as.Date("2001-02-28"), as.Date("2008-05-19"))) |
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
pacman::p_load(tidyverse, scales, glue, extrafont, rvest, polite) | |
# Roboto Condensed font | |
loadfonts() | |
acup_url <- "https://en.wikipedia.org/wiki/AFC_Asian_Cup" | |
# responsible web-scraping ftw! | |
session <- bow(acup_url) | |
acup_winners_raw <- scrape(session) %>% |
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
pacman::p_load(tidyverse, scales, glue, extrafont, rvest, ggtextures, cowplot, polite) | |
# Roboto Condensed font (from hrbrmstrthemes or just Google it) | |
loadfonts() | |
# web scrape | |
topg_url <- "https://en.wikipedia.org/wiki/AFC_Asian_Cup_records_and_statistics" | |
session <- bow(topg_url) | |
ac_top_scorers <- scrape(session) %>% |
OlderNewer