library(tidyverse) count_data_fp <-"/mmfs1/gscratch/comdata/users/mjilg/mw-repo-lifecycles/case1/event_0216_ve_gerrit_count.csv" input_df <- read.csv(count_data_fp, header = TRUE) #window_num <- 19 window_num <- 52 input_df <- input_df |> filter(relative_week >= (- window_num) & relative_week <= (window_num)) |> mutate(parent_projects = if_else(project == "mediawiki/extensions/VisualEditor", "mediawiki/extensions", project)) library(scales) library(ggplot2) time_plot <- input_df |> ggplot(aes(x=relative_week, y=task_count, color=parent_projects)) + labs(x="Weekly Offset", y="New Gerrit Tasks Created", color = "Project") + geom_smooth() + geom_vline(xintercept = 0)+ theme_bw() + theme(legend.position = "top") time_plot abandoned_df <- input_df |> filter(status == "ABANDONED") time_plot <- abandoned_df |> ggplot(aes(x=relative_week, y=task_count, color=parent_projects)) + labs(x="Weekly Offset", y="AbandonedGerrit Tasks Created", color = "Project") + geom_line() + geom_vline(xintercept = 0)+ theme_bw() + theme(legend.position = "top") time_plot delta_df <- input_df |> filter(task_count != 0) |> filter(relative_week >= (- 12)) time_plot <- delta_df |> ggplot(aes(x=relative_week, y=avg_resolution_time, color=parent_projects)) + labs(x="Weekly Offset", y="Avg. (weekly) Time from task creation to last update (days)", color = "Project") + geom_line() + geom_vline(xintercept = 0)+ theme_bw() + theme(legend.position = "top") time_plot loc_df <- input_df |> filter(task_count != 0) |> filter(status != "ABANDONED") time_plot <- loc_df |> ggplot(aes(x=relative_week, y=avg_deletions, color=parent_projects)) + labs(x="Weekly Offset", y="Avg. LOC Deleted per Accepted Gerrit Task", color = "Project") + geom_line() + geom_vline(xintercept = 0)+ theme_bw() + theme(legend.position = "top") time_plot