Learn R Programming

mrgsolve (version 0.8.12)

ev: Event objects for simulating PK and other interventions

Description

An event object contains one or more dosing records that makes up a dosing regimen. The event object may include an ID column, but it usually doesn't. Event objects have operators and other functions that can take simple or elementary event sequences and combine them in potentially more complicated ways.

Usage

ev(x, ...)

# S4 method for mrgmod ev(x, object = NULL, ...)

# S4 method for missing ev(time = 0, evid = 1, ID = numeric(0), cmt = 1, replicate = TRUE, until = NULL, realize_addl = FALSE, ...)

# S4 method for ev ev(x, realize_addl = FALSE, ...)

Arguments

x

a model object

...

passed on

object

passed to show

time

event time

evid

event ID

ID

subject ID

cmt

compartment

replicate

logical; if TRUE, events will be replicated for each individual in ID

until

the expected maximum observation time for this regimen

realize_addl

if FALSE (default), no change to addl doses. If TRUE, addl doses are made explicit with realize_addl

Value

events object

Details

  • Required input for creating events objects include time 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.

  • ID may be specified as a vector.

  • If replicate is TRUE (default), thenthe events regimen is replicated for each ID; otherwise, the number of event rows must match the number of IDs entered

See Also

ev_rep, ev_days, ev_repeat, ev_assign, ev_seq, mutate.ev, as.ev, ev_methods

Examples

Run this code
# NOT RUN {
mod <- mrgsolve:::house()
mod <- mod %>% ev(amt=1000, time=0, cmt=1)
events(mod)

loading <- ev(time=0, cmt=1, amt=1000)
maint <- ev(time=12, cmt=1, amt=500, ii=12, addl=10)
loading + maint


ev(ID=1:10, cmt=1, time=0, amt=100)


# }

Run the code above in your browser using DataLab