From 3e271848eb0075040c02c60e13d5d1f1fd7e183c Mon Sep 17 00:00:00 2001 From: nwickel Date: Sat, 30 Mar 2024 16:43:09 +0100 Subject: [PATCH] Added black and white plots for print version of thesis --- code/11_investigate-variants.R | 29 ++++++++++++++++++++++++++- code/12_dfgs-case-clusters.R | 36 +++++++++++++++++++++++++++++++++- 2 files changed, 63 insertions(+), 2 deletions(-) diff --git a/code/11_investigate-variants.R b/code/11_investigate-variants.R index a585027..44150d6 100644 --- a/code/11_investigate-variants.R +++ b/code/11_investigate-variants.R @@ -8,7 +8,7 @@ # output: ../../thesis/figures/freq-traces.pdf # ../../thesis/figures/freq-traces_powerlaw.pdf # -# last mod: 2024-03-26 +# last mod: 2024-03-30 # setwd("C:/Users/nwickelmaier/Nextcloud/Documents/MDS/2023ss/60100_master_thesis/analysis/code") @@ -68,6 +68,20 @@ legend("topright", paste0("Proportion of traces only occurring once: ", dev.off() +# Black and white +pdf("../../thesis/figures/freq-traces_powerlaw_bw.pdf", height = 3.375, + width = 3.375, pointsize = 10) +par(mai = c(.6,.6,.1,.1), mgp = c(2.4, 1, 0)) + +plot(x, y, log = "xy", xlab = "Absolute Frequency of Traces", + ylab = "Frequency", pch = 16, col = rgb(0.3, 0.3, 0.3, 0.5)) +lines(x, pre, col = "#434F4F") +legend("topright", paste0("Proportion of traces only occurring once: ", + round(tab[1] / nrow(tr), 2)), cex = .7, bty = "n") + +dev.off() + + # Look at individual traces as examples tr[trace_varied == 5 & trace_length > 50, ] # --> every variant exists only once, of course @@ -123,6 +137,19 @@ legend("topright", paste0("Proportion of traces only occurring once: ", dev.off() +# Black and white +pdf("../../thesis/figures/freq-traces_powerlaw_2019_bw.pdf", height = 3.375, + width = 3.375, pointsize = 10) +par(mai = c(.6,.6,.1,.1), mgp = c(2.4, 1, 0)) + +plot(x, y, log = "xy", xlab = "Absolute Frequency of Traces", + ylab = "Frequency", pch = 16, col = rgb(0.3, 0.3, 0.3, 0.5)) +lines(x, pre, col = "#434F4F") +legend("topright", paste0("Proportion of traces only occurring once: ", + round(tab[1] / nrow(tr), 2)), cex = .7, bty = "n") + +dev.off() + # Look at individual traces as examples tr[trace_varied == 5 & trace_length > 50, ] # --> every variant exists only once, of course diff --git a/code/12_dfgs-case-clusters.R b/code/12_dfgs-case-clusters.R index 574f62c..988070c 100644 --- a/code/12_dfgs-case-clusters.R +++ b/code/12_dfgs-case-clusters.R @@ -10,7 +10,7 @@ # ../../thesis/figures/dfg_cases_cluster4_R.pdf # ../../thesis/figures/dfg_cases_cluster5_R.pdf # -# last mod: 2024-03-27 +# last mod: 2024-03-30 # setwd("C:/Users/nwickelmaier/Nextcloud/Documents/MDS/2023ss/60100_master_thesis/analysis/code") @@ -79,6 +79,40 @@ for (i in 1:5) { file_type = "pdf") } +## Black and white +for (i in 1:5) { + + alog <- bupaR::activitylog(dat[dat$cluster == i, ], + case_id = "case", + activity_id = "item", + resource_id = "path", + timestamps = c("start", "complete")) + if (i %in% c(4, 5)) { + + dfg <- processmapR::process_map(edeaR::filter_infrequent_flows(alog, min_n = ns[i]), + type_nodes = processmapR::frequency("relative", color_scale = "Greys"), + sec_nodes = processmapR::frequency("absolute"), + type_edges = processmapR::frequency("relative", color_edges = "black"), + sec_edges = processmapR::frequency("absolute"), + render = FALSE) + + } else { + + dfg <- processmapR::process_map(edeaR::filter_infrequent_flows(alog, min_n = ns[i]), + type_nodes = processmapR::frequency("relative", color_scale = "Greys"), + sec_nodes = processmapR::frequency("absolute"), + type_edges = processmapR::frequency("relative", color_edges = "black"), + sec_edges = processmapR::frequency("absolute"), + rankdir = "TB", + render = FALSE) + + } + + processmapR::export_map(dfg, + file_name = paste0("../../thesis/figures/dfg_cases_cluster_", cl_names[i], "_R_bw.pdf"), + file_type = "pdf") +} + # What data is used and how many traces are unique tr_unique <- numeric(5)