Reads in the input data set and all table output files from a NONMEM run. This function will return a named list with all the relevant tibbles. To return a single tibble with the input data joined to the relevant table outputs, use the related nm_join() function. This function will print the number of rows and columns when each file is loaded. This printing can be suppressed by setting options(bbr.verbose = FALSE).

nm_tables(
  .mod,
  .files = nm_table_files(.mod),
  read_multi_tab = TRUE,
  table_pattern = "TABLE NO",
  ...
)

nm_table_files(.mod, .check_exists = TRUE)

Arguments

.mod

A bbi_nonmem_model or bbi_nonmem_summary object, or a path to a NONMEM run.

.files

Character vector of file paths to table files to read in. Defaults to calling nm_table_files() on .mod, which will parse all file names from $TABLE blocks in the control stream. If passing manually, paths should be either absolute, or relative to get_output_dir(.mod).

read_multi_tab

Logical (T/F). If TRUE, read in files with multiple tables per file. Otherwise they will be skipped.

table_pattern

character string (fixed) defining the start of a new table. Only used if read_multi_tab = TRUE (passed to nm_file_multi_tab()).

...

additional arguments passed to nm_file_multi_tab().

.check_exists

If TRUE check if files exist.

Value

A named list of tibbles. The first element will always be named data and will contain the input data set. Subsequent elements will be named for the file from which they were loaded, with get_model_id(.mod)

(and .) removed from the beginning and end, if present. For example, a model named 001.ctl that generated a table named 001.tab will have the relevant element named tab. Column names in all tibbles will be converted to uppercase.

Details

As described in Value, nm_tables() returns a named list of tibble(s). To return a single tibble will all of this data joined together, see nm_join().

Functions

  • nm_table_files(): Extract paths to table output files from NONMEM control stream, and optionally check if the files exist.