Learn R Programming

ncappc (version 0.2.1.0)

read_nm_table: Read nonmem table files produced.

Description

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")

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 da
only_obs
Should the non-observation lines in the data set be removed? Currently filtered uisng 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
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.

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).