create_doses | R Documentation |
create_doses
generates a data.frame of dosing times and amounts – one
for every subject if subject IDs are provided – based on the dosing regimen
specified. This is meant for generating XML files for use as observed data
overlays for the Simcyp Simulator. Special notes for when you have
more than one value for some items: If you have multiple values for anything
having to do with the compound – the compound ID, administration route, dose
unit, or dose amount (all have the prefix "compound_") – then all the other
arguments having to do with compounds must have that same number of values or
must have only one value, which will be repeated as needed. Really, this
function will just be easier to use if you run it once for each compound you
want. (See the examples at the bottom of the help file.) Similarly, if you
have multiple values for anything having to do with the subject – the
subject ID, age, weight, height, or sex (all have the prefix "subj_") – then
all the other arguments having to do with subjects must have that same number
of values or must have only one value, which will be repeated as needed. Any
time you need to specify multiple values, you can make use of the R function
rep
to repeat elements of a vector. (See the R coding tip for
the argument compound_dose_amount
for an example.)
create_doses(
dose_interval = NA,
num_doses = NA,
end_time = NA,
custom_dosing_schedule = NA,
simulator_version = 22,
compoundID = "Substrate",
compound_dosing_start_time = 0,
compound_dose_route = "Oral",
compound_dose_unit = "mg",
compound_dose_amount = 100,
compound_inf_duration = NA,
subj_ID = NA,
subj_age = NA,
subj_weight = NA,
subj_height = NA,
subj_sex = NA,
save_output = NA
)
dose_interval |
the dosing interval in hours. Default is NA for a single dose. Set this to, e.g., 24 for a QD dosing regimen. |
num_doses |
the number of doses to generate. If this is left as NA and
you have specified the dose interval, then the value for |
end_time |
the end time of the dosing in hours. If |
custom_dosing_schedule |
a custom dosing schedule to be used for each
subject in hours, e.g., |
simulator_version |
the version of the simulator that will be used. This affects what columns will be included in hte output. |
compoundID |
specify the compound that's being dosed. Options are
"Substrate" (default), "Inhibitor 1", "Inhibitor 2", or "Inhibitor 3". Not
case sensitive. If you list more than one compound, you must also list more
than one |
compound_dosing_start_time |
the start time of compound administration (h); default is 0. |
compound_dose_route |
the route of administration. Options are "Oral" (default), "Intravenous", "Dermal", "Inhaled", "SC-First Order", "SC-Mechanistic", or "Auto-detect". Not case sensitive. |
compound_dose_unit |
the unit of dosing. Options are "mg" (default), "mg/m2", or "mg/kg". |
compound_dose_amount |
the amount of the dose. If this amount varies,
please include one dose amount for each time. For example:
|
compound_inf_duration |
the infusion duration (min) (optional) |
subj_ID |
optionally specify subject IDs as, e.g., |
subj_age |
age (years) (optional) |
subj_weight |
weight (kg) (optional) |
subj_height |
height (cm) (optional) |
subj_sex |
sex; options are "F" or "M" (optional) |
save_output |
the file name to use for saving the output as a csv; if left as NA, this will generate a data.frame in R but no output will be saved. |
a data.frame
# QD dosing regimen of 100 mg
create_doses(dose_interval = 24, num_doses = 4)
# QD dosing regimen of 100 mg for subjects A, B, and C
create_doses(dose_interval = 24, num_doses = 4,
subj_ID = c("A", "B", "C"))
# QD dosing regimen of 100 mg for subjects A, B, and C and save output
create_doses(dose_interval = 24, num_doses = 4,
subj_ID = c("A", "B", "C"),
save_output = "My doses.csv")
# Custom dosing regimen for subjects A, B, and C
create_doses(custom_dosing_schedule = c(0, 12, 24, 48, 92, 168),
subj_ID = c("A", "B", "C"))
# If you have multiple compounds -- say you've got a DDI study with both a
# substrate and a perpetrator -- this will probably be easiest to manage if you
# run create_doses once for each compound. It just gets pretty
# complicated pretty quickly to have a substrate with one dosing interval,
# start time, and amount and then an inhibitor with a *different* dosing
# interval, start time, and amount. Here's an example of how you could do this
# but still get just one csv file at the end:
# Substrate is dosed one time at 10 mg starting at t = 168 h.
Doses_sub <- create_doses(num_doses = 1, compoundID = "Substrate",
compound_dosing_start_time = 168,
compound_dose_amount = 10)
# Inhibitor is dosed QD at 500 mg for 336 h starting at t = 0 h.
Doses_inhib <- create_doses(dose_interval = 24, end_time = 336,
compoundID = "Inhibitor 1",
compound_dosing_start_time = 0,
compound_dose_amount = 500)
MyDoses <- bind_rows(Doses_sub, Doses_inhib)
write.csv(MyDoses, file = "Dose rows for sub and inhib.csv",
row.names = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.