Skip to content

Commit

Permalink
Bugfix looking time for very small time bins that only have a single …
Browse files Browse the repository at this point in the history
…fixation.

Lookings used to exceed the boundaries of the give time bin.
This is fixed in this commit.
  • Loading branch information
kalaschnik committed Jul 6, 2023
1 parent a29fed4 commit 5396a10
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion eyewit/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: eyewit
Title: Bootstrapping Common Eyetracking Tasks around Tobii’s I-VT Filter
Version: 0.4.6
Version: 0.4.7
Date: 2022-02-22
Authors@R:
person("Steven", "Kalinke", , "[email protected]", role = c("aut", "cre"),
Expand Down
5 changes: 5 additions & 0 deletions eyewit/R/get_looks.R
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,11 @@ get_looks <- function(df,
start_ms <- df$timestamp[current_start]
end_ms <- df$timestamp[which(df$fi == i)][length(which(df$fi == i))]

# this is important for the timebinning function. This is for small time bins that hit only one fixation
if (min_fi == max_fi && !missing(intra_scope_window) && (end_ms - start_ms > intra_scope_window[2] - intra_scope_window[1])) {
end_ms <- df$timestamp[current_end]
}

# set the difference of start_ms and end_ms to the current gazeDuration
current_gazeDuration <- end_ms - start_ms
# Add it to the total
Expand Down

0 comments on commit 5396a10

Please sign in to comment.