# setwd("C:/Users/nwickelmaier/Nextcloud/Documents/MDS/2023ss/60100_master_thesis/data/ContentEyevisit/eyevisit_cards_light") rm(list=ls()) dat0 <- read.table("../../event_logfiles.csv", sep = ";", header = TRUE) dat0$artwork <- sprintf("%03d", dat0$artwork) # artwork names artworks <- sort(unique(dat0$artwork)) # create data frame with file names and topics for each artwork dat <- NULL file_order <- NULL for (artwork in artworks) { fnames <- dir(pattern = paste0(artwork, "_"), path = artwork, full.names = TRUE) topic <- NULL for (fname in fnames) { topic <- c(topic, gsub("^$", "\\1", grep("^$", "\\1", grep("^