| evid_ | R Documentation |
evid_() is a model-only function that schedules a future dosing or
observation event during ODE solving. It is evaluated at each output
time point and inserts the requested event into the individual's event
timeline for future processing.
This function has no meaning outside an rxode2 model block and will throw an error if called directly from R.
evid_(time, evid, amt, cmt = 1, rate = 0, ii = 0, addl = 0, ss = 0)
time |
Numeric. The time at which the event should occur. Must
be greater than the current model time |
evid |
Integer event ID. Follows NONMEM/rxode2 conventions:
|
amt |
Numeric dose amount (for dose events) or |
cmt |
Integer compartment number (1-based) to which the dose is applied. Default is 1 |
rate |
Numeric infusion rate.
|
ii |
Numeric inter-dose interval. Used together with |
addl |
Integer number of additional doses beyond the first.
The total number of doses pushed is |
ss |
Integer steady-state flag applied to the first dose only
(
|
evid_() is evaluated at every output time point (when the solver is
exactly at a scheduled event time). The pushed event is inserted into
the individual's event timeline and the solver visits it at the
specified future time.
The number of events that may be pushed per individual is limited by
the maxExtra argument of rxSolve(). When maxExtra = 0
(the default) there is no limit. Exceeding the limit causes an
error.
Past-time pushes (where time <= t) are silently ignored and counted;
a warning is issued after solving.
The argument order and names mirror the standard NONMEM dataset
columns: TIME, EVID, AMT, CMT, RATE, II, ADDL, SS.
This function is only meaningful inside an rxode2 model; it
returns NULL invisibly if called from R directly (after signaling
an error).
rxSolve() for the maxExtra control argument. Other
more convenient ways to interact with adaptive observations and
events include bolus() infuse(), infuseDur(),
reset().
# Push a single bolus of 50 mg to compartment 1 at t + 12
m <- rxode2({
d/dt(depot) <- -ka * depot
d/dt(central) <- ka * depot - cl / vd * central
cp <- central / vd
if (t < 24) {
evid_(t + 12, 1, 50, 1, 0, 0, 0, 0)
}
})
# Push three boluses (addl = 2) at t+6, t+18, t+30 (ii = 12)
m2 <- rxode2({
d/dt(depot) <- -ka * depot
d/dt(central) <- ka * depot - cl / vd * central
cp <- central / vd
if (t < 1) {
evid_(t + 6, 1, 50, 1, 0, 12, 2, 0)
}
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.