R/helpers-getters.R

Defines functions get_times_events get_trial_events get_trial_with_event_indices

get_trial_with_event_indices <- function(test, event){
  indices <- unique(which(test$data$Sender == "Trial" & test$data$Event == event))
  return(indices + 1)
}

get_trial_events <- function(exp_log, iTrials){
  events_log <- exp_log[exp_log$Sender == "Trial" & (exp_log$Index %in% (iTrials-1)),]
  return(events_log)
}

get_times_events <- function(exp_log, event_name){
  times <- exp_log[exp_log$Event == event_name, "Time"]
  return(times)
}
BrainVR/brainvr-reader documentation built on Nov. 2, 2021, 11:09 a.m.