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(httr) | |
library(k5) | |
# mens owgr --------------------------------------------------------------- | |
a <- GET( | |
url = "https://apiweb.owgr.com/api/owgr/rankings/getRankings", | |
query = list( |
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(scales) | |
library(rvest) | |
x <- read_html("https://en.wikipedia.org/wiki/List_of_countries_by_level_of_military_equipment") | |
clean_wiki <- function(x) { | |
x %>% | |
str_remove_all("\\[(.*)\\]") %>% |
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(jsonlite) | |
library(scales) | |
library(fs) | |
library(k5) | |
# functions --------------------------------------------------------------- | |
most_common <- function (x, n = 6) { | |
as.vector(na.omit(names(sort(table(x), decreasing = TRUE)[1:n]))) |
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(tabulizer) | |
library(janitor) | |
library(scales) | |
library(fs) | |
ipsos_pdf <- file_temp(ext = "pdf") | |
download.file( | |
"https://www.ipsos.com/sites/default/files/ct/news/documents/2021-09/Understanding%20Society%20Wave%2018%20Topline_083121.pdf", | |
destfile = ipsos_pdf |
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(lubridate) | |
x <- seq(from = mdy("January 23, 1845"), to = today(), by = "1 day") | |
x[year(x) %% 4 == 0 & month(x) == 11 & day(x) <= 7 & wday(x) == 2] + 1 |
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
# Disables webcam audio. | |
SUBSYSTEM=="usb", DRIVER=="snd-usb-audio", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="0991", ATTR{authorized}="0" |
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
# install.packages("usa") | |
library(tidyverse) | |
x <- usa::counties %>% | |
filter(state %in% state.abb) %>% | |
group_by(state) %>% | |
arrange(name, .by_group = TRUE) %>% | |
mutate(first_letter = str_sub(name, end = 1)) %>% | |
filter(first_letter == first_letter[length(first_letter)/2]) %>% |
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(lubridate) | |
library(jsonlite) | |
library(janitor) | |
library(rvest) | |
# state pop history ------------------------------------------------------- | |
# look for zip export from stl fed | |
# zip has 2016-2019, not on wikipedia |
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(patchwork) | |
library(tidyverse) | |
library(lubridate) | |
library(jsonlite) | |
library(predictr) | |
library(scales) | |
library(rvest) | |
# get vap estimate -------------------------------------------------------- |
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(rvest) | |
# scrape state votes from wikipedia table | |
prez_wiki <- read_html("https://w.wiki/Zqi") | |
vote_table <- prez_wiki %>% | |
html_node(xpath = '//*[@id="mw-content-text"]/div[1]/div[40]/table') %>% | |
html_table(fill = TRUE) %>% | |
as_tibble(.name_repair = "unique") |
NewerOlder