Make timeline of events

make_event_timeline(
  num_trials = 5,
  events = c("A", "B", "C"),
  onsets = list(1, round(rnorm(5, 50, 10)), 1),
  durations = list(25, 25, 199)
)

Arguments

num_trials

integer, the number of trials

events

character vector, names of each event

onsets

list, containing an integer, or vector, defining onsets for each event

durations

list, containing an integer, or vector, defining durations for each event

Value

dataframe

Examples

make_event_timeline(
 num_trials = 5,
 events = c('A', 'B', 'C'),
 onsets = list(1,round(rnorm(5,50,10)),1),
 durations = list(25,25,199)
 )
#>    trial_num event onset duration offset
#> 1          1     A     1       25     26
#> 2          1     B    51       25     76
#> 3          1     C     1      199    200
#> 4          2     A     1       25     26
#> 5          2     B    68       25     93
#> 6          2     C     1      199    200
#> 7          3     A     1       25     26
#> 8          3     B    39       25     64
#> 9          3     C     1      199    200
#> 10         4     A     1       25     26
#> 11         4     B    49       25     74
#> 12         4     C     1      199    200
#> 13         5     A     1       25     26
#> 14         5     B    49       25     74
#> 15         5     C     1      199    200