Skip to content

Instantly share code, notes, and snippets.

Jarrett Byrnes jebyrnes

View GitHub Profile
@jebyrnes
jebyrnes / coauthors_nsf_coa.R
Last active Aug 1, 2020
Get your coauthors for the last 4 years, nsf-style
View coauthors_nsf_coa.R
library(scholar)
library(dplyr)
library(purrr)
library(tidyr)
id <- "hJKBuhkAAAAJ"
#me <- get_profile(id)
pubs <- get_publications(id) %>% as_tibble
@jebyrnes
jebyrnes / goog_mobility_wtg.R
Created May 27, 2020
Google Mobility on world tile map
View goog_mobility_wtg.R
#devtools::install_github("hrbrmstr/worldtilegrid")
library(worldtilegrid)
library(dplyr)
library(ggplot2)
goog <- refresh_covid19mobility_google_country()
data(wtg)
goog_april <- filter(goog,
as.character(date) %in% c("2020-04-15", "2020-02-15", "2020-03-15", "2020-05-15"),
data_type=="retail_and_recreation_percent_change_from_baseline") %>%
@jebyrnes
jebyrnes / iso_3166_2_subdivision_scrape.R
Created May 27, 2020
Get the iso subdivision codes from wikipedia
View iso_3166_2_subdivision_scrape.R
library(rvest)
library(dplyr)
library(purrr)
library(tidyr)
# https://en.wikipedia.org/wiki/ISO_3166-2
baseurl <- "https://en.wikipedia.org"
url <- "https://en.wikipedia.org/wiki/ISO_3166-2"
# get the tables from which spring links!
View get_buoy.R
library(tidyverse)
library(readr)
get_buoy <- function(a_year){
one_buoy <- read_buoy(a_year) %>%
format_buoy %>%
make_monthly_buoy
return(one_buoy)
}
View coronavirus_us_progression.R
library(coronavirus)
library(dplyr)
library(ggplot2)
library(rnaturalearth)
library(sf)
library(ggrepel)
library(wesanderson)
coronavirus <- update_coronavirus()
usa <- ne_states(country = "United States of America", returnclass = "sf")
@jebyrnes
jebyrnes / coronavirus_heatmap.R
Created Mar 7, 2020
A first stab at making useful heatmaps from the coronavirus data
View coronavirus_heatmap.R
#devtools::install_github("RamiKrispin/coronavirus")
library(coronavirus)
library(dplyr)
library(ggplot2)
library(tidyr)
library(rnaturalearth)
library(sf)
View neverWarrenBots.R
#note, above this, use rtweet
#instructions for getting api keys and the like
#from http://dev.twitter.com
library(rtweet)
library(tweetbotornot)
library(ggplot2)
library(dplyr)
library(ggridges)
token <- create_token(
@jebyrnes
jebyrnes / biking.R
Created Nov 5, 2019
A quick interactive map of biking for #tidytuesday
View biking.R
library(tidyverse)
library(ggmap)
library(sf)
library(tmap)
#whereami?
here::here()
#get my apis flowin'
register_google(readLines("~/goog.api"))
@jebyrnes
jebyrnes / chanty_analysis.R
Last active Oct 25, 2019
Some tidytext anaylysis of sea chanties
View chanty_analysis.R
library(tidyverse)
library(tidytext)
library(rvest)
library(ggplot)
#get the initial info from the site
site <- "http://www.guscantieni.com/bindarrr/"
index <- read_html(paste0(site, "index.html"))
View rayshade_maps_gg.R
#Rayshader reprex to try and put a flat raster map under a
#set of 3d points
library(rayshader)
library(ggplot2)
library(dplyr)
library(maps)
library(ggmap)
data(world.cities)
You can’t perform that action at this time.