Skip to content

Instantly share code, notes, and snippets.

@kylebaron
Created April 26, 2016 21:03
Show Gist options
  • Save kylebaron/a0389c8301db64a633a285aece81e9d2 to your computer and use it in GitHub Desktop.
Save kylebaron/a0389c8301db64a633a285aece81e9d2 to your computer and use it in GitHub Desktop.
Des
library(dplyr)
library(magrittr)
library(mrgsolve)
library(rbenchmark)
code <- '
$CMT GUT CENT PERIPH
$PKMODEL ncmt=2, trans=2
$PARAM CL=1, V2=20, Q = 12, V3 = 200, KA=2
'
mod <- mrgsolve:::house()
df <- expand.ev(ID=1:3, amt=c(50,100))
df
data(exTheoph)
df <- exTheoph
head(df)
out <-
mod %>%
Req(CP) %>%
carry.out(a.u.g) %>%
data_set(df) %>%
obsaug %>%
mrgsim
des1 <- tgrid(0,24,1, add=0.2)
des2 <- tgrid(0,96,1)
df %<>% mutate(GRP = as.integer(ID > 5))
id <- df %>% distinct(ID) %>% select(ID,GRP)
out <-
mod %>%
Req(CP) %>%
carry.out(a.u.g,GRP) %>%
idata_set(id) %>%
data_set(df) %>%
design(descol="GRP", deslist=list(des1,des2)) %>%
obsaug %>%
mrgsim
plot(out, CP~time|GRP)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment