Skip to content

Commit

Permalink
ensure page_offset is set to zero for start 0 or 1
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentvanhees committed Mar 27, 2024
1 parent 3518084 commit 63055d3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/readGENEActiv.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ readGENEActiv = function(filename, start = 0, end = 0, progress_bar = FALSE,
}

# Correct timestamps
if (start > 0) {
if (start > 1) {
page_offset = (((start - 1) * 300) / rawdata$info$SampleRate)

Check warning on line 74 in R/readGENEActiv.R

View check run for this annotation

Codecov / codecov/patch

R/readGENEActiv.R#L74

Added line #L74 was not covered by tests
} else {
page_offset = 0
}
starttime_num = as.numeric(starttime_posix) + page_offset
rawdata$time = rawdata$time + abs(rawdata$time[1]) + starttime_num
Expand Down

0 comments on commit 63055d3

Please sign in to comment.