Open billdenney opened 2 years ago
I had this feature when I first started working with rxode but used regular expressions. I thought if was to fragile. I thinj if we do it it should be with parsing.
Should it be in nlmixr2plot?
@mattfidler , Good point that it should be in nlmixr2plot. I moved the issue.
I think that it can be done with parsing and that it can be robust for what it does. As I'm thinking about it now, there will be some specific limitations about how the model equations will have to be formatted. It should be possible to loosen those with time.
Perhaps this can also be looked at in another direction. Using shiny+diagram to create models. It would be less fragile? And perhaps more useful for some...
Once we have the ability to make a graph (in the "set of nodes and vertices" sense), it should be straight-forward to visualize the diagram in many different ways. To me, the fragility will be in the creation of the graph.
Automatic model diagrams would be hard to get right, but I think that we could possibly get close (good enough for most reports and giving the user something to work from in any case). This will be oriented toward PK/PD models, and it should work okay with PK combined to a single PD model, I think.
Here is how I'm thinking of it:
I think that all of this could be automated. The way that I'm doing it right now would add dependencies of
tidygraph
andggraph
.An example is in https://github.com/thomasp85/ggraph/issues/316#issuecomment-1152972487