Skip to contents

The function reads in NONMEM table files. The files can be created from the $EST line or from the $SIM line in a NONMEM model file.

Usage

read_nm_table(
  nm_table,
  only_obs = FALSE,
  method = "default",
  quiet = TRUE,
  sim_num = FALSE,
  sim_name = "NSIM",
  verbose = FALSE
)

Arguments

nm_table

The NONMEM table file to read. A text string. If dplyr and readr are available and method="default" or method="readr_*" then nm_table can either a path to a file, a connection, or literal data (either a single string or a raw vector). Files ending in .gz, .bz2, .xz, or .zip will be automatically uncompressed. Files starting with http://, https://, ftp://, or ftps:// will be automatically downloaded. Remote gz files can also be automatically downloaded & decompressed.

only_obs

Should the non-observation lines in the data set be removed? Currently filtered using the expected MDV column. TRUE or FALSE.

method

Can be one of default, readr_1, readr_2, readr_3, slow. readr_1 should be fastest. All but slow require dplyr and readr (version >= 0.2.2).

quiet

Should there be verbose messages about what the function is doing?

sim_num

Should the function add a column to the returned data frame that identifies the simulation number (if present)?

sim_name

The name of the resulting column in the returned data frame if sim_num is true.

verbose

Should the output be more verbose for error checking?

Value

Returns a data frame of the simulated table with an added column for the simulation number. The data frame is given class c("tbl_df", "tbl", "data.frame") for easy use with dplyr.

Details

Currently the function searches the $TABLE for multiple header lines, and uses that to identify multiple simulations. The function expects at least one header line (NOHEADER option is not allowed in NONMEM table files).