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")
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.