Event objects for simulating PK and other interventions
An event object specifies dosing or other interventions that get implemented
during simulation. Event objects do similar things as data_set
,
but simpler and quicker.
ev(x, ...) ## S4 method for signature 'mrgmod' ev(x, object = NULL, ...) ## S4 method for signature 'missing' ev( time = 0, amt = 0, evid = 1, cmt = 1, ID = numeric(0), replicate = TRUE, until = NULL, tinf = NULL, realize_addl = FALSE, ... ) ## S4 method for signature 'ev' ev(x, realize_addl = FALSE, ...)
x |
a model object |
... |
other items to be incorporated into the event object; see details |
object |
passed to show |
time |
event time |
amt |
dose amount |
evid |
event ID |
cmt |
compartment |
ID |
subject ID |
replicate |
logical; if |
until |
the expected maximum observation time for this regimen |
tinf |
infusion time; if greater than zero, then the |
realize_addl |
if |
Required items in events objects include
time
, amt
, evid
and cmt
.
If not supplied, evid
is assumed to be 1.
If not supplied, cmt
is assumed to be 1.
If not supplied, time
is assumed to be 0.
If amt
is not supplied, an error will be generated.
If total
is supplied, then addl
will be set
to total
- 1.
Other items can include ii
, ss
, and addl
(see data_set
for details on all of these items).
ID
may be specified as a vector.
If replicate is TRUE
(default), then the events
regimen is replicated for each ID
; otherwise, the number of
event rows must match the number of ID
s entered
events object
mod <- mrgsolve::house() mod <- mod %>% ev(amt=1000, time=0, cmt=1) loading <- ev(time=0, cmt=1, amt=1000) maint <- ev(time=12, cmt=1, amt=500, ii=12, addl=10) c(loading, maint) loading$time
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.