Fixed issue with glossar in add_path_items

This commit is contained in:
Nora Wickelmaier 2024-06-28 18:29:27 +02:00
parent 05a8dbe689
commit fd30d58102
2 changed files with 8 additions and 5 deletions

View File

@ -8,4 +8,4 @@ Description: Creating event logs from raw log files from a Multi-Touch-Table at
License: GPL (>= 2)
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1

View File

@ -1,10 +1,12 @@
###########################################################################
add_path_items <- function(subdata) {
add_path_items <- function(subdata, glossar) {
pbapply::pboptions(style = 3, char = "=")
subdata_glossar <- subdata[subdata$item == "glossar", ]
subdata_glossar$path <- NA
if (glossar) {
subdata_glossar <- subdata[subdata$item == "glossar", ]
subdata_glossar$path <- NA
}
items <- unique(subdata$item)[unique(subdata$item) != "glossar"]
@ -56,6 +58,7 @@ add_path_items <- function(subdata) {
###########################################################################
add_path_glossar <- function(subdata, xmlpath) {
# TODO: I think this needs to be completely redone
# TODO: Think about getting rid of all of the glossar stuff
pb <- utils::txtProgressBar(min = 0, max = nrow(subdata), initial = NA,
style = 3)
@ -116,7 +119,7 @@ add_path <- function(data, xmlpath, glossar) {
subdata1 <- data[data$event %in% c("Transform start", "Transform stop"), ]
subdata2 <- data[!data$event %in% c("Transform start", "Transform stop"), ]
subdata2 <- add_path_items(subdata2)
subdata2 <- add_path_items(subdata2, glossar = glossar)
if (glossar) {
subdata2 <- add_path_glossar(subdata2, xmlpath)