Updated script; removed old stuff

This commit is contained in:
Nora Wickelmaier 2024-03-22 12:17:39 +01:00
parent 9ad5123747
commit 24c7967246

View File

@ -5,10 +5,11 @@
# (3) Select features for navigation behavior
# (4) Export data frames
#
# input: results/haum/event_logfiles_2024-02-21_16-07-33.csv
# output: results/haum/eventlogs_pre-corona_case-clusters.csv
# input: results/event_logfiles_2024-02-21_16-07-33.csv
# output: results/dataframes_case_2019.RData
# results/centrality_cases.RData
#
# last mod: 2024-03-08
# last mod: 2024-03-22
# setwd("C:/Users/nwickelmaier/Nextcloud/Documents/MDS/2023ss/60100_master_thesis/analysis/code")
@ -16,7 +17,7 @@ source("R_helpers.R")
#--------------- (1) Read data ---------------
load("results/haum/eventlogs_pre-corona_cleaned.RData")
load("results/eventlogs_pre-corona_cleaned.RData")
# Select one year to handle number of cases
dat <- dat[as.Date(dat$date.start) > "2018-12-31" &
@ -135,8 +136,8 @@ dattree <- data.frame(case = datcase$case,
)
# centrality <- pbapply::pbsapply(dattree$case, get_centrality, data = dat)
# save(centrality, file = "results/haum/tmp_centrality.RData")
load("results/haum/tmp_centrality.RData")
# save(centrality, file = "results/centrality_cases.RData")
load("results/centrality_cases.RData")
dattree$BetweenCentrality <- centrality
@ -171,17 +172,5 @@ dattree$AvDurItemNorm <- normalize(dattree$AvDurItem)
#--------------- (4) Export data frames ---------------
save(dat, datcase, dattree, file = "results/haum/dataframes_case_2019.RData")
write.table(datcase,
file = "results/haum/datcase.csv",
sep = ";",
quote = FALSE,
row.names = FALSE)
write.table(datcase,
file = "results/haum/dattree.csv",
sep = ";",
quote = FALSE,
row.names = FALSE)
save(dat, datcase, dattree, file = "results/dataframes_case_2019.RData")