Skip to content

Instantly share code, notes, and snippets.

@noamross
Last active April 1, 2018 17:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noamross/0d1e28608f263ee633b48b0df50f13e8 to your computer and use it in GitHub Desktop.
Save noamross/0d1e28608f263ee633b48b0df50f13e8 to your computer and use it in GitHub Desktop.
Checking editor workloads for rOpenSci onboarding
library(tidyverse)
library(gh)
library(lubridate)
issues <- gh("/repos/ropensci/onboarding/issues?state=all&labels=package", .limit=1000)
edits = map_df(issues,
~data_frame(url = .$html_url,
editor = .$assignee$login %||% NA_character_,
opened = as.Date(.$created_at))) %>%
filter(!is.na(editor)) %>%
mutate(quarter = paste(year(opened), quarter(opened), sep="Q"),
half = paste(year(opened), if_else(quarter(opened) <= 2, 1, 2), sep="H"),
year = year(opened))
edits %>%
group_by(editor, half) %>%
summarize(n_assigned = n()) %>%
{ full_join(., crossing(editor = unique(.$editor), #can't get expand() to work.
half = unique(.$half))) } %>%
mutate(n_assigned = coalesce(n_assigned, 0L)) %>%
ggplot(aes(x=half, y=n_assigned, fill=editor)) +
geom_col(position="dodge") +
geom_hline(yintercept = c(3, 6)) +
xlab("Half / Year") + ylab("No. Issues Handled")
@maelle
Copy link

maelle commented Apr 1, 2018

So compact and elegant ,realllly nice @noamross

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment