shinyUI(fluidPage(  
  tabsetPanel(
    tabPanel("plot",
      fluidRow(
        plotOutput("plot", height = 250),
        sliderInput("k", "k:", 0.1, 2, 0.5),
        sliderInput("V", "V:", 1, 20, 5)
      )),
    tabPanel("ui.R", pre(includeText("ui.R"))),
    tabPanel("server.R", pre(includeText("server.R")))
  )
))
library(mlxR)

shinyServer(function(input, output){
  
  t <- seq(0,5,by=0.2)
  adm <- list(amount=10, time=0)
  r <- reactive({ 
    p <- c(ka=0.5, V=input$V, k=input$k)
    res   <- pkmodel(time=t,treatment=adm,parameter=p)
    return(res)
  })
  
  output$plot <- renderPlot({
    pl <- ggplot(data=r()) + geom_line(aes(x=time, y=cc)) 
    print(pl)
  })
  
})