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(tidyverse) | |
theme_538 <- function() { | |
theme( | |
plot.title = element_text(face = "bold", | |
family = "Helvetica", | |
size = 18, | |
color = "#222222", | |
lineheight = 0.5, | |
vjust = 1), | |
plot.subtitle = element_text(family = "Helvetica", |
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(tidyverse) | |
library(janitor) | |
library(rvest) | |
npvic_wiki <- read_html("https://en.wikipedia.org/wiki/National_Popular_Vote_Interstate_Compact") | |
enacted <- npvic_wiki %>% | |
html_node("table.wikitable:nth-child(71)") %>% | |
html_table() %>% | |
as_tibble(.name_repair = make_clean_names) %>% |
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
# this script automates the collection, processing, and plotting of gridwatch energy data | |
# 2019-05-27 | |
# @kiernann | |
# u/WannabeWonk | |
# install.packages("pacman") | |
pacman::p_load( | |
RSelenium, | |
readr, | |
dplyr, |
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, tidytext) | |
read_html("http://podcastsearch.david-smith.org/episodes/2003") %>% | |
html_nodes("p") %>% | |
html_text() %>% | |
str_squish() %>% | |
str_trim() %>% | |
str_remove("◼ ► ") %>% | |
enframe(NULL, "line_text") %>% | |
rownames_to_column("line_no") %>% | |
unnest_tokens(word, "line_text") %>% |
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, | |
lubridate, | |
snakecase, | |
here, | |
glue, | |
fs | |
) | |
mid <- 3633 |
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(eurostat) # eurostat data | |
library(rnaturalearth) # worldwide map data | |
library(tidyverse) # tidy data transformation | |
library(lubridate) # date and time support | |
library(sf) # simple features GIS | |
euro_pop <- | |
get_eurostat('demo_r_pjanaggr3', stringsAsFactors = FALSE) %>% | |
filter( | |
str_length(geo) == 5, # NUTS-3 |
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
mdp <- structure( | |
list( | |
color = rep( | |
x = c( | |
"amber", "blue", "brown", "cyan", "deepOrange", "deepPurple", | |
"green", "grey", "indigo", "lightBlue", "lightGreen", "lime", | |
"orange", "pink", "purple", "red", "teal", "yellow" | |
), | |
each = 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
library(tidyverse) | |
library(janitor) | |
library(magrittr) | |
library(campfin) | |
library(rvest) | |
url_edu <- "https://en.wikipedia.org/wiki/List_of_U.S._states_and_territories_by_educational_attainment" | |
url_life <- "https://en.wikipedia.org/wiki/List_of_U.S._states_and_territories_by_life_expectancy" | |
url_gdp <- "https://en.wikipedia.org/wiki/List_of_U.S._states_by_GDP_per_capita" | |
url_hdi <- "https://en.wikipedia.org/wiki/List_of_U.S._states_and_territories_by_Human_Development_Index" |
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(tibble) | |
library(tidyr) | |
library(glue) | |
data <- tribble( | |
~ address, | |
"8548 Mammoth Drive, Sumter, SC, 29150", | |
"9725 Spring St., Apt 1, Piscataway, NJ, 08854", | |
"Apple co., 75 Applegate Ave., Encino, CA, 91316", | |
"26 Sherwood Ave., Reading, MA, 01867", |
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(jsonlite) | |
library(tidyverse) | |
library(magrittr) | |
url <- "https://gist.githubusercontent.com/oliveratgithub/0bf11a9aff0d6da7b46f1490f86a71eb/raw/ac8dde8a374066bcbcf44a8296fc0522c7392244/emojis.json" | |
shortcodes <- | |
fromJSON(url) %>% | |
use_series("emojis") %>% | |
as_tibble() %>% | |
na_if("") %>% |
OlderNewer