74 lines
3.8 KiB
R
74 lines
3.8 KiB
R
library(tidyverse)
|
|
|
|
c1_count <-"/mmfs1/gscratch/comdata/users/mjilg/mw-repo-lifecycles/case1/062725_c1_cleaned_phab.csv"
|
|
c1_input_df <- read.csv(c1_count , header = TRUE)
|
|
|
|
c2_count <-"/mmfs1/gscratch/comdata/users/mjilg/mw-repo-lifecycles/case2/062725_c2_cleaned_phab.csv"
|
|
c2_input_df <- read.csv(c2_count , header = TRUE)
|
|
|
|
c3_count <-"/mmfs1/gscratch/comdata/users/mjilg/mw-repo-lifecycles/case3/062725_c3_cleaned_phab.csv"
|
|
c3_input_df <- read.csv(c3_count , header = TRUE)
|
|
|
|
#phase of feature deployments
|
|
# pre opt-in (0)
|
|
# opt-in beta (1)
|
|
# post-announcement pre-deployment (2)
|
|
# post-deployment opt-out (3)
|
|
# c1 key dates
|
|
# opt-in = as.Date("2012-12-11)
|
|
# deployment announcement = as.Date("2013-06-06")
|
|
# deployment_date <- as.Date("2013-07-01")
|
|
|
|
c1_input_df <- c1_input_df |>
|
|
mutate(date_created = as.numeric(as.POSIXct(date_created, tz = "UTC"))) |>
|
|
mutate(source = "c1") |>
|
|
mutate(phase = case_when(
|
|
date_created < as.numeric(as.POSIXct("2012-12-11", tz = "UTC")) ~ 0, # pre opt-in
|
|
date_created >= as.numeric(as.POSIXct("2012-12-11", tz = "UTC")) & date_created < as.numeric(as.POSIXct("2013-06-06", tz = "UTC")) ~ 1, # opt-in beta
|
|
date_created >= as.numeric(as.POSIXct("2013-06-06", tz = "UTC")) & date_created < as.numeric(as.POSIXct("2013-07-01", tz = "UTC")) ~ 2, # post-announcement pre-deployment
|
|
date_created >= as.numeric(as.POSIXct("2013-07-01", tz = "UTC"))~ 3 # post-deployment opt-out
|
|
))
|
|
|
|
|
|
# c2 key dates
|
|
# opt-in = as.Date("2011-10-03)
|
|
# deployment announcement = as.Date("2013-08-01")
|
|
# deployment_date <- as.Date("2013-08-28")
|
|
|
|
c2_input_df <- c2_input_df |>
|
|
mutate(date_created = as.numeric(as.POSIXct(date_created, tz = "UTC"))) |>
|
|
mutate(source = "c2") |>
|
|
mutate(phase = case_when(
|
|
date_created < as.numeric(as.POSIXct("2011-10-03", tz = "UTC")) ~ 0, # pre opt-in
|
|
date_created >= as.numeric(as.POSIXct("2011-10-03", tz = "UTC")) & date_created < as.numeric(as.POSIXct("2013-08-01", tz = "UTC")) ~ 1, # opt-in beta
|
|
date_created >= as.numeric(as.POSIXct("2013-08-01", tz = "UTC")) & date_created < as.numeric(as.POSIXct("2013-08-28", tz = "UTC")) ~ 2, # post-announcement pre-deployment
|
|
date_created >= as.numeric(as.POSIXct("2013-08-28", tz = "UTC"))~ 3 # post-deployment opt-out
|
|
))
|
|
|
|
# c3 key dates
|
|
# opt-in = as.Date("2013-08-01)
|
|
# deployment announcement = as.Date("2015-06-12")
|
|
# deployment_date <- as.Date("2015-07-02")
|
|
c3_input_df <- c3_input_df %>%
|
|
mutate(date_created = as.numeric(as.POSIXct(date_created, tz = "UTC"))) |>
|
|
mutate(source = "c3") |>
|
|
mutate(phase = case_when(
|
|
date_created < as.numeric(as.POSIXct("2013-08-01", tz = "UTC")) ~ 0, # pre opt-in
|
|
date_created >= as.numeric(as.POSIXct("2013-08-01", tz = "UTC")) & date_created < as.numeric(as.POSIXct("2015-06-12", tz = "UTC")) ~ 1, # opt-in beta
|
|
date_created >= as.numeric(as.POSIXct("2015-06-12", tz = "UTC")) & date_created < as.numeric(as.POSIXct("2015-07-02", tz = "UTC")) ~ 2, # post-announcement pre-deployment
|
|
date_created >= as.numeric(as.POSIXct("2015-07-02", tz = "UTC"))~ 3 # post-deployment opt-out
|
|
))
|
|
|
|
# Combine the dataframes into one
|
|
combined_df <- bind_rows(c1_input_df, c2_input_df, c3_input_df)
|
|
|
|
combined_task_df <- combined_df %>%
|
|
filter(comment_type == "task_description") |>
|
|
mutate(time_to_close = date_closed - date_created,
|
|
time_to_close_hours = as.numeric(difftime(date_closed, date_created, units = "hours"))
|
|
)
|
|
|
|
ggplot(combined_task_df, aes(x = priority_score, y = phase, color = source)) +
|
|
geom_point(alpha = 0.6) + # Points, with some transparency
|
|
geom_smooth(method = "loess", se = TRUE) + # LOESS curve, no confidence band
|
|
theme_minimal() |