I tried to deploy my R shinyapps.io. Once deployed it, I encountered the error message: "An error has occurred. Check your logs or contact the app author for clarification"
This is the code I'm using which is also from Simulx website for PK-PD simulation.
library(mlxR)
library(ggplot2)
## user value inputs -----------------------------------------------------------------
fixedRow(
column(6,
sliderInput("amt", "Dosing amount (mg):", 0, 1000, 50, step=10)),
column(6,
sliderInput("V", "Volume of distribution (L):", 0, 100, 10, step=1)),
column(6,
sliderInput("Cl", "Select a Clearance rate (L/hr):", 0, 10, 1, step=1)),
column(6,
sliderInput("tfd", "Select the time for first dose (hr):", 0, 10, 5, step=1)),
column(6,
sliderInput("nd", "Number of doses:", 0, 20, 5, step=1)),
column(6,
sliderInput("ii", "Dosing Interval (hr):", 0, 20, 4, step=1))
)
## plot output code-------------------------------------------------------------------
renderPlot({
myModel1 <- inlineModel("
[LONGITUDINAL]
input = {V, Cl}
PK:
depot(target=Ac)
EQUATION:
k = Cl/V
ddt_Ac = -k*Ac
Cc=Ac/V
")
t1 <- input$tfd
t2 <- input$ii*(input$nd-1)+t1
adm <- list(time=seq(t1, t2,input$ii), amount=input$amt)
Cc <- list(name='Cc',time=seq(from=0, to=100, by=1))
p <- c(V=input$V, Cl=input$Cl)
res <- simulx(model=myModel1,
parameter=p,
output=Cc,
treatment=adm)
ggplot(data=res$Cc, aes(x=time, y=Cc)) + geom_line(size=1)
})
I'm using the library(mlxR) in my app and using simulx( ) which run perfectly locally. Is it the mlxR that is causing the problem? I also installed lixoft locally.
Thank you for your help.