Import model estimates from a NONMEM xml file
nmxml(
run = numeric(0),
project = character(0),
file = character(0),
path = character(0),
root = c("working", "cppfile"),
theta = TRUE,
omega = TRUE,
sigma = TRUE,
olabels = NULL,
slabels = NULL,
oprefix = "",
sprefix = "",
tname = "THETA",
oname = "...",
sname = "...",
index = "last",
xpath = ".//nm:estimation",
env = NULL
)
A list with theta, omega and sigma elements, depending on what was requested.
run number.
project directory.
deprecated; use path
instead.
the complete path to the run.xml
file.
the directory that path
and project
are relative to; this is
currently limited to the working
directory or cppdir
, the directory
where the model file is located.
logical; if TRUE, the $THETA
vector is returned.
logical; if TRUE, the $OMEGA
matrix is returned.
logical; if TRUE, the $SIGMA
matrix is returned.
labels for $OMEGA
.
labels for $SIGMA
.
prefix for $OMEGA
labels.
prefix for $SIGMA
labels.
name for $THETA
.
name for $OMEGA
.
name for $SIGMA
.
the estimation number to return; "last" will return the last estimation results; otherwise, pass an integer indicating which estimation results to return.
xml path containing run results; if the default doesn't work,
consider using .//estimation
as an alternative; see details.
internal use only.
If run
and project
are supplied, the .xml
file is
assumed to be located in run.xml
, in directory run
off the project
directory. If file
is supplied,
run
and project
arguments are ignored.
This function requires that the xml2 package
be installed and loadable. If requireNamespace("xml2")
fails, an error will be generated.
nmxml
usually expects to find run results in the xpath called
.//nm:estimation
. Occasionally, the run results are not stored in
this namespace but no namespaces are found in the xml file. In this case,
the user can specify the xpath containing run results. Consider trying
.//estimation
as an alternative if the default fails.
nmext
if(requireNamespace("xml2")) {
proj <- system.file("nonmem", package = "mrgsolve")
mrgsolve:::nmxml(run = 1005, project = proj)
}
Run the code above in your browser using DataLab