This file contains hidden or 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 | |
pacman::p_load(tidyverse, scales, janitor, gt, rvest, polite, glue, webshot) | |
## Data | |
tidy_anime <- readr::read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-04-23/tidy_anime.csv") | |
## get Gundam data | |
gundam_raw <- tidy_anime %>% | |
select(-related, -background, -premiered, -related, -members, -airing, -favorites, | |
-title_synonyms, -title_japanese, -producers, -status, -broadcast, -genre, -source, -rank, -popularity) %>% |
This file contains hidden or 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, polite, scales, ggimage, | |
rvest, glue, extrafont, ggrepel, magick) | |
loadfonts() | |
url <- "https://www.transfermarkt.com/j1-league/startseite/wettbewerb/JAP1/plus/?saison_id=2017" | |
session <- bow(url) | |
team_links <- scrape(session) %>% | |
html_nodes("#yw1 > table > tbody > tr > td.zentriert.no-border-rechts > a") %>% |
This file contains hidden or 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 | |
pacman::p_load(tidyverse, polite, scales, ggimage, rvest, | |
glue, extrafont, ggrepel, magick, ggforce) | |
loadfonts() | |
## add logo function | |
add_logo <- function(plot_path, logo_path, logo_position, logo_scale = 10){ | |
# Requires magick R Package https://github.com/ropensci/magick |
This file contains hidden or 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 | |
pacman::p_load(tidyverse, scales, lubridate, ggrepel, sf, | |
glue, extrafont, readxl, jpndistrict, geofacet, cowplot, | |
gghighlight, magick) | |
loadfonts(device = "win", quiet = TRUE) | |
# data from eStat.go.jp: https://www.e-stat.go.jp/stat-search/files?page=1&layout=datalist&toukei=00200524&tstat=000000090001&cycle=0&tclass1=000000090004&tclass2=000001051180 | |
# specifically data file: 05k5-5.xls | |
jpn_pop_raw <- read_xls(glue("{here::here()}/data/05k5-5.xls"), skip = 9, | |
col_types = c("skip", "text", "skip", "text", |
This file contains hidden or 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 | |
pacman::p_load(tidyverse, lubridate, geofacet, gghighlight, | |
sf, extrafont, glue, RColorBrewer, emo) | |
# font packages | |
loadfonts(device = "win") | |
# import and clean | |
# download from JMA website: http://www.data.jma.go.jp/gmd/risk/obsdl/index.php | |
# choose TokyoPrefecture/Tokyo Station, Monthly data, Jan. 1872 to Dec. 2018 |
This file contains hidden or 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
# load packages | |
pacman::p_load(tidyverse, scales, ggbeeswarm, extrafont, glue, magick) | |
# load fonts | |
loadfonts() | |
# load data | |
launches_raw <- read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-01-15/launches.csv") | |
# wrangle data |
This file contains hidden or 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) %>% |
This file contains hidden or 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 hidden or 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 hidden or 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) |