Calculate time span in days

calculate_days_ecu(
  start_form = NULL,
  startdate,
  end_form = NULL,
  enddate,
  primary_form = NA,
  pid
)

Arguments

start_form

form which includes start date. NULL if one is not working across forms

startdate

vector of start dates of time span or column name within start_form containing date variable

end_form

form which includes end date. NULL if one is not working across forms

enddate

vector of end dates of time span or column name within end_form containing date variable

primary_form

"start" if the time span will be merged to start_form. "end" if the time span will be merged to end_form. NA if one is not working across forms

pid

column name of patient ID in trial_data

Value

vector of duration of time span in days

Note

TODO: consider using start_form_mnppid and end_form_mnppid instead of entire forms, see hap/40-core-analysis