Read in table file with multiple NONMEM
tables.
nm_file_multi_tab(.path, add_table_names = TRUE, table_pattern = "TABLE NO")
a path to a table file.
Logical (T/F). If TRUE
, include a column denoting
the table names as specified in the file (e.g., 'TABLE NO. 1'
).
character string defining the start of a new table (regex accepted).
either a tibble
or list depending on the column names of each table
The returned object will change depending on the types of tables contained in the file:
If each table is the same number of rows and column names (e.g., simulation data), the file can be read-in all at once (significant performance improvements), and the data will be coerced to a single dataframe.
If the number of rows differ across any of the tables, they must be read in one at a time.
If the column names differ across any of the tables, a list of tables is returned.
If a single dataframe can be returned, an additional nn
column will be
appended denoting the table number. This would also be the simulation number
if running a simulation (removing the need to keep track of iterations within
the control stream itself).
This function expects that tables are in the following format by default (column names can differ as noted above):