Helper function to sort dose data set by ID and time variables.
sortDoses(
data,
idVar = "id",
infusionDoseTimeVar = NULL,
bolusDoseTimeVar = NULL,
otherDoseTimeVar = NULL
)
data.frame; data set with dose information
character string; name of ID variable, defaults to id
character string; name of infusion dose time variable
character string; name of bolus dose time variable
character string; name of additional dose time variable
data.frame, containing dose data
Sort order will be the ID variable, then infusion time, bolus time, or other dose date-time variables.