Make AB timeline

make_AB_timeline(
  num_trials = 5,
  events = c("A", "B"),
  A_onsets = 1,
  A_durations = 50,
  B_onsets = 50,
  B_durations = 50
)

Arguments

num_trials

integer, the number of trials to add to timeline

events

character vector, defaults to A and B events

A_onsets

integer vector, the onset times for each A event on each trial

A_durations

integer vector, the duration times for each A event on each trial

B_onsets

integer vector, the onset times for each B event on each trial

B_durations

integer vector, the duration times for each B event on each trial

Value

data.frame

Examples

make_AB_timeline(
 num_trials = 5,
 events = c('A', 'B'),
 A_onsets = 1,
 A_durations = 50,
 B_onsets = round(rnorm(5,100,10)),
 B_durations = 50
)
#>    trial_num event onset duration offset
#> 1          1     A     1       50     51
#> 2          1     B    99       50    149
#> 3          2     A     1       50     51
#> 4          2     B   117       50    167
#> 5          3     A     1       50     51
#> 6          3     B    96       50    146
#> 7          4     A     1       50     51
#> 8          4     B   106       50    156
#> 9          5     A     1       50     51
#> 10         5     B   104       50    154