xpose_data {xpose} | R Documentation |
Import NONMEM output into R
Description
Gather model outputs into a R database
Usage
xpose_data(
runno = NULL,
prefix = "run",
ext = ".lst",
file = NULL,
dir = NULL,
gg_theme = theme_readable,
xp_theme = theme_xp_default(),
simtab = NULL,
manual_import = NULL,
ignore = NULL,
check_ext = TRUE,
extra_files,
quiet,
...
)
Arguments
runno |
Run number to be used to generate model file name. Used in
combination with |
prefix |
Prefix to be used to generate model file name. Used in
combination with |
ext |
Extension to be used to generate model file name. Should be one of '.lst' (default), '.out', '.res', '.mod' or '.ctl' for NONMEM. |
file |
Model file name (preferably a '.lst' file) containing the file
extension. Alternative to |
dir |
Location of the model files. |
gg_theme |
A complete ggplot2 theme object (e.g.
|
xp_theme |
A complete xpose theme object (e.g.
|
simtab |
If |
manual_import |
If |
ignore |
Character vector be used to ignore the import/generation of: 'data', 'files', 'summary' or any combination of the three. |
check_ext |
Logical, if |
extra_files |
A vector of additional output file extensions to be imported. Default is '.ext', '.cov', '.cor', '.phi', '.grd' for NONMEM. |
quiet |
Logical, if |
... |
Additional arguments to be passed to the
|
File path generation
The rules for model file names generation are as follow:
with
runno
: the full path is generated as<dir>/<prefix><runno>.<ext>
e.g. withdir = 'model/pk'
,prefix = 'run'
,runno = '001'
,ext = '.lst'
the resulting path would bemodel/pk/run001.lst
with
file
: the full path is generated as<dir>/<file>
e.g. withdir = 'model/pk'
,file = 'run001.lst'
the resulting path would also bemodel/pk/run001.lst
. Note: in this case the file extension should be provided as part of the 'file' argument.
Table format requirement
When importing data, an ID
column
must be present in at least one table for each problem and for each
'firstonly' category. ID
columns are required to properly
combine/merge tables and removing NA
records. If ID
columns
are missing xpose will return the following warning: Dropped
`<tablenames>` due to missing required `ID` column.
Examples
## Not run:
# Using the `file` argument to point to the model file:
xpdb <- xpose_data(file = 'run001.lst', dir = 'models')
# Using the `runno` argument to point to the model file:
xpdb <- xpose_data(runno = '001', ext = '.lst', dir = 'models')
# Using the `extra_files` argument to import specific output files only:
xpdb <- xpose_data(file = 'run001.lst', dir = 'models', extra_files = c('.ext', '.phi'))
# Using `ignore` to disable import of tables and output files:
xpdb <- xpose_data(file = 'run001.lst', dir = 'models', ignore = c('data', 'files'))
# Using `simtab` to disable import of simulation tables
xpdb <- xpose_data(file = 'run001.lst', dir = 'models', simtab = FALSE)
## End(Not run)