Ran checks and updated
This commit is contained in:
parent
d21d52e84c
commit
d264e0e267
@ -57,7 +57,7 @@ close_events <- function(data, event = c("move", "flipCard", "openTopic", "openP
|
|||||||
|
|
||||||
# remove eventIds associated with more than one trace, usually logging
|
# remove eventIds associated with more than one trace, usually logging
|
||||||
# errors that I cannot resolve
|
# errors that I cannot resolve
|
||||||
corrupt_eventIds <- names(which(rowSums(xtabs( ~ eventId + trace, subdata) != 0) != 1))
|
corrupt_eventIds <- names(which(rowSums(stats::xtabs( ~ eventId + trace, subdata) != 0) != 1))
|
||||||
subdata <- subdata[!subdata$eventId %in% corrupt_eventIds, ]
|
subdata <- subdata[!subdata$eventId %in% corrupt_eventIds, ]
|
||||||
|
|
||||||
if (event == "flipCard") {
|
if (event == "flipCard") {
|
||||||
@ -233,19 +233,19 @@ close_events <- function(data, event = c("move", "flipCard", "openTopic", "openP
|
|||||||
|
|
||||||
# fix durations that span more than one log file
|
# fix durations that span more than one log file
|
||||||
if (event != "move") {
|
if (event != "move") {
|
||||||
tab <- colSums(xtabs( ~ fileId + trace, subdata) != 0)
|
tab <- colSums(stats::xtabs( ~ fileId + trace, subdata) != 0)
|
||||||
number_logfiles <- data.frame(trace = names(tab), nlogfile = tab)
|
number_logfiles <- data.frame(trace = names(tab), nlogfile = tab)
|
||||||
data_wide <- merge(data_wide, number_logfiles, by = "trace", all.x = TRUE)
|
data_wide <- merge(data_wide, number_logfiles, by = "trace", all.x = TRUE)
|
||||||
data_wide$duration[data_wide$identi == "corrupt"] <-
|
data_wide$duration[data_wide$identi == "corrupt"] <-
|
||||||
(data_wide$nlogfile[data_wide$identi == "corrupt"] - 1) * 600000 -
|
(data_wide$nlogfile[data_wide$identi == "corrupt"] - 1) * 600000 -
|
||||||
data_wide$timeMs.start[data_wide$identi == "corrupt"] +
|
data_wide$timeMs.start[data_wide$identi == "corrupt"] +
|
||||||
data_wide$timeMs.stop[data_wide$identi == "corrupt"]
|
data_wide$timeMs.stop[data_wide$identi == "corrupt"]
|
||||||
# TODO: This assumes that no log files are skipped
|
# TODO: This assumes that no log files are skipped
|
||||||
# --> Is this assumption really valid??
|
# --> Is this assumption really valid??
|
||||||
} else {
|
} else {
|
||||||
data_wide$duration[data_wide$identi == "corrupt"] <-
|
data_wide$duration[data_wide$identi == "corrupt"] <-
|
||||||
600000 -
|
600000 -
|
||||||
data_wide$timeMs.start[data_wide$identi == "corrupt"] +
|
data_wide$timeMs.start[data_wide$identi == "corrupt"] +
|
||||||
data_wide$timeMs.stop[data_wide$identi == "corrupt"]
|
data_wide$timeMs.stop[data_wide$identi == "corrupt"]
|
||||||
} # there should be no movements spanning more than two log files!
|
} # there should be no movements spanning more than two log files!
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user