[R-sig-dyn-mod] Using Desolve to simulate drug concentrations

Thomas Petzoldt thomas.petzoldt at tu-dresden.de
Tue Mar 27 08:43:35 CEST 2018


Hi,

the warnings and the error at the end of your code are thrown by 
functions from the shiny and the ggplot2 packages. The usual debugging 
method works by developing and testing all parts separately, before 
gluing it together. Some people call this "bottom-up" programming:

1) test your dynamic model without ggplot2 and shiny.

2) test the shiny and ggplot2 parts without deSolve, just by supplying 
fake data.

If you encounter problems with either (1) or (2), split it again in 
smaller pieces.

If all pieces work as expected, put them together, step by step.

Thomas


Am 26.03.2018 um 20:49 schrieb Meenakshi Srinivasan:
> Dear group,
> 
> *I'm new to R and deSolve. Using an example I found in a publication, I
> tried to develop a model that can simulate drug concentrations for various
> scenarios (based on body weight, albumin, sex and other covariates).*
> 
> *The running model code is as below-*

[...]

> *I'm getting the error which is as follows-*
> 
> ```
> Listening on http://127.0.0.1:6899
> Warning: <anonymous>: ... may be used in an incorrect context: ‘.fun(piece,
> ...)’
> 
> Warning: <anonymous>: ... may be used in an incorrect context: ‘.fun(piece,
> ...)’
> 
> Warning: Error in : ggplot2 doesn't know how to deal with data of class
> numeric
> Stack trace (innermost first):
>      105: fortify.default
>      104: fortify
>      103: structure
>      102: ggplot.data.frame
>      101: ggplot.default
>      100: ggplot
>       99: renderPlot [C:\Users\ms1225\Downloads\Shiny_code_2/server.R#222]
>       89: <reactive:plotObj>
>       78: plotObj
>       77: origRenderFunc
>       76: output$plotCONC
>        1: runApp
> ```
> 
> *Can you please help me with what I might have missed?*
> 
> *Thank you so much for your help. Will be happy to clarify any doubts
> regarding the code. *
> *The server is essentially the final model code which is modified.*
> 
> Thanks!
> 
> Sincerely,



More information about the R-sig-dynamic-models mailing list