Skip to content

Instantly share code, notes, and snippets.

@kylebaron
Created June 1, 2017 01:48
Show Gist options
  • Save kylebaron/26b726affdea1fc45e5d7ad7fec0e2b9 to your computer and use it in GitHub Desktop.
Save kylebaron/26b726affdea1fc45e5d7ad7fec0e2b9 to your computer and use it in GitHub Desktop.
Modeling Infusion Duration
library(mrgsolve)
code <- '
$PARAM CL = 1, V = 5, D1 = 1
$PKMODEL cmt="CENT"
$MAIN
D_CENT = D1;
'
mod <- mcode_cache("rate", code)
idata <- data.frame(D1 = seq(1,20,2))
mod %>%
ev(amt=100, rate=-2) %>%
mrgsim(idata=idata,delta=0.1, end=48) %>%
plot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment