create_clones.RdPass a one-row-per-patient data.frame and get back a data.frame with one row per clone.
create_clones(
df,
id,
event,
time_to_event,
exposure,
time_to_exposure,
ced_window = NULL
)A data.frame with one row per patient.
The name of the column in df that contains the patient identifier.
The name of the column in df that contains the event of interest.
The name of the column in df that contains the time to event.
The name of the column in df that contains the exposure.
The name of the column in df that contains the time to exposure.
The date at which the clinical eligibility window closes. Can be left empty, in which case the clinical eligibility window is assumed to be part of
exposure and time_to_exposure
A data.frame with one row per clone.
# Load the toy dataset
data(dummy_data)
# Create clones
clones <- create_clones(dummy_data,
id = "id",
event = "event",
time_to_event = "timetoevent",
exposure = "exposure",
time_to_exposure = "timetoexposure",
ced_window = 100)
#> Updating 4 patients' exposure and time-to-exposure based on CED window