Skip to content

Commit

Permalink
fixed bug in epoch script
Browse files Browse the repository at this point in the history
  • Loading branch information
gustxsr committed Jan 16, 2025
1 parent ac1a558 commit f44c81a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions R/epoch.R
Original file line number Diff line number Diff line change
Expand Up @@ -454,10 +454,15 @@ slice_epochs_no_limits <- function(x_raw, all_ts) {
}

slice_epochs_with_limits <- function(x_raw, cur_ts, lims, hz) {
s_time <- cur_ts + (lims[1] * hz)
e_time <- cur_ts + (lims[2] * hz)
s_time <- cur_ts + (lims[1] * 1000)
e_time <- cur_ts + (lims[2] * 1000)
epoch_df <- slice_epoch(x_raw, s_time, e_time)

return(slice_epoch(x_raw, s_time, e_time))
duration <- sum(abs(lims[1]), abs(lims[2]))
n_samples <- duration / (1 / hz)

epoch_df <- epoch_df[1:n_samples, ]
return(epoch_df)
}

epoch_manually <- function(eyeris, ts_list, hz) {
Expand Down

0 comments on commit f44c81a

Please sign in to comment.