Skip to content

Instantly share code, notes, and snippets.

@dgrtwo
Created October 13, 2016 15:36
Show Gist options
  • Save dgrtwo/59fa7e1feb8c910907d882567b06cda1 to your computer and use it in GitHub Desktop.
Save dgrtwo/59fa7e1feb8c910907d882567b06cda1 to your computer and use it in GitHub Desktop.
library(tidyverse)
library(lubridate)
questions <- readr::read_csv("~/Repositories/stacklite/questions.csv.gz")
question_tags <- readr::read_csv("~/Repositories/stacklite/question_tags.csv.gz")
r_questions <- question_tags %>%
filter(Tag == "r")
r_questions_by_month <- questions %>%
semi_join(r_questions, by = "Id") %>%
mutate(Month = round_date(CreationDate, "month"))
r_questions_by_month %>%
count(Deleted = !is.na(DeletionDate), Month) %>%
mutate(Percent = n / sum(n)) %>%
ggplot(aes(Month, Percent, color = Deleted)) +
geom_line()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment