model_diff.RdBy default, this compares a model's model file on disk to the model file of
its "parent" model (the model referenced in its based_on field). It can
optionally take a second model (passed to .mod2), in which case it
will compare the first model to the second model, ignoring the based_on
field entirely.
model_diff(.mod, .mod2 = NULL, .file = "model", ..., .viewer = FALSE) # S3 method for bbi_nonmem_model model_diff(.mod, .mod2 = NULL, .file = c("model"), ..., .viewer = FALSE)
| .mod | The |
|---|---|
| .mod2 | If a |
| .file | Defaults to |
| ... | arguments passed through to methods. (Currently none.) |
| .viewer | If |
Returns a "Diff" object from the diffobj package that renders
when printed or called in the console.
Printing vs. knitting: When using this function in an .Rmd file that
you intend to knit to HTML, be sure to set the chunk option results = "asis" for the relevant chunk. If you do this, the model_diff() output
will render nicely in color in the HTML doc. Note this only works for HTML
output. If you are are rendering to a different format (PDF, DOCX, etc.)
you can still use model_diff() without results = "asis" and it will
render, although it won't look particularly nice.
based_on details: As described above, if .mod2 is NULL (the default),
then the .mod will be compared to the model returned by get_based_on(.mod).
However, if there is more than one model (or no models) in .mod$based_on, then user
will be prompted to explicitly pass the model they want to compare against to
the .mod2 argument.
.file argument: The following options are available for .file
bbi_nonmem_model
"model" compares the control streams
Currently only NONMEM is implemented.