Skip to contents

Reads NONMEM output tables.

Usage

read_nmtables(
  tableFiles = NULL,
  runNo = NULL,
  tabSuffix = "",
  tableNames = c("sdtab", "mutab", "patab", "catab", "cotab", "mytab", "extra", "xptab"),
  quiet = FALSE,
  directory = NULL,
  output_type = c("data.frame", "list"),
  ...
)

Arguments

tableFiles

NONMEM table files to be read.

runNo

Run number.

tabSuffix

Table file suffix.

tableNames

List of root table names, using the Xpose naming convention as the default.

quiet

Flag for displaying intermediate output.

directory

The directory to look for files within. If NULL, uses the current directory.

output_type

Should output be a "data.frame" where all results are merged or a "list" of data.frames.

...

Passed to each of the read functions (ignored in the functions).

Value

A data.frame or list of data.frames depending on the output_type argument.

Details

When output_type = "data.frame", per-subject (FIRSTONLY) tables are joined to the others by ID. Tables with one row per record are combined row by row, relying on NONMEM writing every table of a run in the same record order. Columns the tables share (such as ID and TIME) are checked for agreement first, and kept once. That check can only detect misaligned rows where the shared columns tell records apart. Where they cannot, e.g. a dose and an observation at the same ID and TIME, or tables with no columns in common, the rows are combined in file order. Tables from different runs, or edited after NONMEM wrote them, may then be silently misaligned; read them with output_type = "list" instead.

Note

Adapted from Xpose 4 (https://CRAN.R-project.org/package=xpose4).

References

NONMEM (https://www.iconplc.com/solutions/technologies/nonmem)

Jonsson EN, Karlsson MO. Xpose–an S-PLUS based population pharmacokinetic/pharmacodynamic model building aid for NONMEM. Comput Methods Programs Biomed. 1999 Jan;58(1):51-64

Author

Bill Denney, Justin Wilkins, Niclas Jonsson, Andrew Hooker

Examples

if (FALSE) { # \dontrun{
tables <- read_nmtables(runNo=315)
} # }