Skip to content

Instantly share code, notes, and snippets.

Andrew Stewart ajstewartlang

Block or report user

Report or block ajstewartlang

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Opeth Twitter scraping
library(tidyverse)
library(rtweet)
library(tidytext)
library(grid)
library(igraph)
library(ggraph)
library(stringi)
library(leaflet)
library(ggthemes)
@ajstewartlang
ajstewartlang / Tidy_Tuesday_2019_10_01
Last active Oct 1, 2019
Tidy_Tuesday_2019_10_01 - Greenwich Village and Soho Top 5 Pizza Restaurants
View Tidy_Tuesday_2019_10_01
# Greenwich Village and Soho Top 5 Pizza Restaurants
library(tidyverse)
library(leaflet)
pizza_barstool <- read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-10-01/pizza_barstool.csv")
zip_list <- c(10012, 10013, 10014)
ready_to_plot <- pizza_barstool %>%
filter(zip %in% zip_list) %>%
View gist:f569bc7a1e17eceed700061f6f004cfb
library(tidyverse)
library(rtweet)
library(tidytext)
library(grid)
library(igraph)
library(ggraph)
library(stringi)
library(leaflet)
library(ggthemes)
View animated_plus_t_tests
library(tidyverse)
library(gganimate)
source("https://gist.githubusercontent.com/ajstewartlang/6c4cd8ab9e0c27747424acdfb3b4cff6/raw/fb53bd97121f7f9ce947837ef1a4c65a73bffb3f/geom_flat_violin.R")
set.seed(3)
all_data <- NULL
sample_size <- 500
for(sample in 1:10) {
@ajstewartlang
ajstewartlang / Tidy_Tuesday_May_21_2019_v3
Last active May 21, 2019
Tidy_Tuesday_May_21_2019_v3
View Tidy_Tuesday_May_21_2019_v3
library(tidyverse)
library(janitor)
library(countrycode)
library(ggthemes)
mismanaged_vs_gdp <- read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-05-21/per-capita-mismanaged-plastic-waste-vs-gdp-per-capita.csv")
mismanaged_vs_gdp <- clean_names(mismanaged_vs_gdp)
mismanaged_vs_gdp$continent <- countrycode(sourcevar = mismanaged_vs_gdp$entity,
origin = "country.name",
destination = "continent")
View Tidy_Tuesday_May_21_2019
library(tidyverse)
library(janitor)
library(countrycode)
library(ggthemes)
waste_vs_gdp <- read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-05-21/per-capita-plastic-waste-vs-gdp-per-capita.csv")
waste_vs_gdp <- clean_names(waste_vs_gdp)
waste_vs_gdp$continent <- countrycode(sourcevar = waste_vs_gdp$entity,
@ajstewartlang
ajstewartlang / TidyTuesday_May21_2019
Last active May 21, 2019
TidyTuesday_May21_2019
View TidyTuesday_May21_2019
library(tidyverse)
library(janitor)
library(countrycode)
library(ggthemes)
coast_vs_waste <- read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-05-21/coastal-population-vs-mismanaged-plastic.csv")
coast_vs_waste <- clean_names(coast_vs_waste)
coast_vs_waste$continent <- countrycode(sourcevar = coast_vs_waste$entity,
@ajstewartlang
ajstewartlang / epl_goal_contribution_matrix_18-19.r
Created May 20, 2019 — forked from Ryo-N7/epl_goal_contribution_matrix_18-19.r
Goal contribution matrix for Premier League 2018-2019
View epl_goal_contribution_matrix_18-19.r
# pkgs
pacman::p_load(tidyverse, polite, scales, ggimage, ggforce,
rvest, glue, extrafont, ggrepel, magick)
loadfonts()
## add_logo function from Thomas Mock
add_logo <- function(plot_path, logo_path, logo_position, logo_scale = 10){
# Requires magick R Package https://github.com/ropensci/magick
View gist:58ea1c2a3278d5def03b0576f4bb3bec
library(tidyverse)
library(ggthemes)
library(tools)
library(gganimate)
library(ggimage)
full_trains <- read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-02-26/full_trains.csv")
p <- full_trains %>%
filter(service == "International" & year == 2017) %>%
@ajstewartlang
ajstewartlang / gist:b272364c0d5bfea5beb28ab3c0a66e15
Last active Feb 8, 2019
Simulation_script_10000_expts_cohens_d_.5
View gist:b272364c0d5bfea5beb28ab3c0a66e15
library(tidyverse)
library(broom)
library(Hmisc)
total_samples <- 10000
sample_size <- 128
participant <- rep(1:sample_size)
condition <- c(rep("fast", times = sample_size/2), rep("slow", times = sample_size/2))
all_data <- NULL
You can’t perform that action at this time.