Introduction

Example Shiny

The code below will create a Shiny app on-the-fly. The model can either be passed using the code argument (fast C++ approach), or using the ode argument (R::deSolve approach).

library(PKPDsim)
library(PKPDsimShiny)
library(shiny)

p <- list(CL = 1, V  = 10)

omega <- c(0.3,       # IIV CL
           0.1, 0.3)  # IIV V

pk1cmtiv <- new_ode_model(code = "dAdt[1] = -(CL/V)*A[1]; ")
r <- new_regimen(amt = 100, n = 5, interval = 12)

sim_ode_shiny(ode = pk1cmtiv,
              par = p,
              regimen = r,
              omega = omega)

# runApp("~/shiny-pkpd")

Shiny

Troubleshooting

If you encounter the following message when trying to run a Shiny app:

Error in handler(req) :
  argument "metaHandler" is missing, with no default

you should update the Shiny library:

install.packages("shiny")


ronkeizer/PKPDsimShiny documentation built on May 27, 2019, 1:50 p.m.