mtt_haum/code/01_preprocessing_8o8m.R

29 lines
833 B
R
Raw Normal View History

# setwd("C:/Users/nwickelmaier/Nextcloud/Documents/MDS/2023ss/60100_master_thesis/code")
#library(mtt)
devtools::load_all("../../../../software/mtt")
now <- format(Sys.time(), "%Y-%m-%d_%H-%M-%S")
folders <- dir("../data/8o8m/LogFiles/")
#folders <- "Berlin"
# parse raw log files
datraw <- parse_logfiles(folders, path = "../data/8o8m/LogFiles/")
artworks <- unique(na.omit(datraw$artwork))
# export data
write.table(datraw, paste0("../data/8o8m/raw_logfiles_", now, ".csv"),
sep = ";", row.names = FALSE)
datraw2 <- datraw[!is.na(datraw$artwork), ]
# TODO: Why is this happening?
# convert to log events
datlogs <- create_eventlogs(datraw2, xmlpath = "../data/8o8m/Content8o8m/")
# export data
write.table(datlogs, paste0("../data/8o8m/event_logfiles_", now, ".csv"),
sep = ";", row.names = FALSE)