xpose_data: Import NONMEM output into R

Description Usage Arguments File path generation Table format requirement Examples

View source: R/xpose_data.R

Description

Gather model outputs into a R database

Usage

1
2
3
4
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, extra_files, quiet, ...)

Arguments

runno

Run number to be used to generate model file name. Used in combination with prefix and ext.

prefix

Prefix to be used to generate model file name. Used in combination with runno and ext.

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 prefix, runno and ext arguments.

dir

Location of the model files.

gg_theme

A ggplot2 theme object (e.g. theme_classic).

xp_theme

An xpose theme or vector of modifications to the xpose theme (e.g. c(point_color = 'red', line_linetype = 'dashed')).

simtab

If TRUE only reads in simulation tables, if FALSE only reads estimation tables. Default NULL reads all tables. Option not compatible with manual_import.

manual_import

If NULL (default) the names of the output tables to import will be obtained from the model file. To manually import files as in previous versions of xpose, the check the function manual_nm_import.

ignore

Character vector be used to ignore the import/generation of: 'data', 'files', 'summary' or any combination of the three.

extra_files

A vector of additional output file extensions to be imported. Default is '.ext', '.cov', '.cor', '.phi', ".grd" for NONMEM.

quiet

Logical, if FALSE messages are printed to the console.

...

Additional arguments to be passed to the read_delim functions.

File path generation

The rules for model file names generation are as follow:

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## 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)

UUPharmacometrics/xpose documentation built on Jan. 21, 2019, 7:08 a.m.