toTrialDuration function

Convert event data to trial duration data A helper function to create a custom event table. The observation time will start from the first event time (baseline) and end at trial duration. The interval is the spacing between each observation.

Convert event data to trial duration data A helper function to create a custom event table. The observation time will start from the first event time (baseline) and end at trial duration. The interval is the spacing between each observation.

toTrialDuration(ev, trialEnd, interval, writeDir = NULL)

Arguments

  • ev: event data
  • trialEnd: extend trial duration. Must be same time unit as event data
  • interval: observation interval. Must be same time unit as event data
  • writeDir: if not NULL, write the output to a csv file

Examples

# Create event table with unique time for each ID ev = et(data.frame(id = rep(1:10, 3), time = runif(min = 10, max = 20, n = 30))) # select the duration and spacing interval (assuming time is in years) toTrialDuration(ev, trialEnd = 1.5, interval = 0.2)

Author(s)

Omar Elashkar