View source: R/nm.insert.dose.multiple.compartments.r
nm.insert.dose.multiple.compartments | R Documentation |
To model drug entry into the system from multiple absorption sites this function allows to turn a NONMEM datset into one with additional doses in differetn compartments.
nm.insert.dose.multiple.compartments(
data,
dose.in.cmt = c(1, 2),
...,
quiet = TRUE
)
data |
NONMEM data.frame, should contain variable 'CMT' |
dose.in.cmt |
numeric double or vector for new CMT doses |
... |
(unquoted) columns to sort the result by |
quiet |
when TRUE (default) silences the messages returned |
A data.frame with input dataset supplied with additional doses
nm.insert.evid2amt0
library(dplyr)
## original data:
nmData = example.NONMEM.dataset(TIME = seq(0,24,4))
nmData$CMT = with(nmData, swap(EVID, 0:1, 2:1))
## adding doses to compartments 3, 4 and 5
nmData3 = nm.insert.dose.multiple.compartments(data = nmData
, dose.in.cmt = c(3,4,5)
, ID, TIME, -EVID
)
tbl_df(nmData3[, c('ID','TIME','EVID','AMT','CMT','DV')])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.