nm_join_impl | R Documentation |
nm_join()
Implementation function for nm_join()
nm_join_impl(
.mod,
.join_col = "NUM",
.files = nm_table_files(.mod),
.superset = FALSE,
.bbi_args = list(no_grd_file = TRUE, no_shk_file = TRUE)
)
.mod |
A |
.join_col |
Character column name to use to join table files. Defaults to
|
.files |
Character vector of file paths to table files to read in.
Defaults to calling |
.superset |
If |
.bbi_args |
Named list passed to |
The .join_col
is the name of a single column that should appear in both the
input data set and any tables you want to join. We recommend you make this
column a simple integer numbering the rows in the input data set (for example
NUM
). When this column is carried into the output table files, there will
be unambiguous matching from the table file back to the input data set.
The one exception to this are FIRSTONLY
tables. If a table file has the
same number of rows as the there are individuals in the input data set
(accounting for any filtering of data in the NONMEM control stream), it
will assumed to be a FIRSTONLY
table. In this case, the table will be
joined to the input data by the ID
column. If ID
is not present in
the table, it will be using .join_col
. Note that if neither ID
or
the column passed to .join_col
are present in the table, the join will
fail.
Note also that, when .join_col
is carried into table outputs, there is no
need to table any other columns from the input data as long as the
nm_join()
approach is used; any column in the input data set, regardless
of whether it is listed in $INPUT
or not, will be carried through from the
input data and therefore available in the joined result.
Duplicate Rows Warning for Join Column
If there are duplicate rows found in the specified .join_col
, a warning
will be raised specifying a subset of the repeated rows. Duplicates may be
caused by lack of output width. FORMAT
may be need to be stated in control
stream to have sufficient width to avoid truncating .join_col
.
.join_col
Take the following $INPUT
and $DATA
records:
$INPUT ID TIME MDV EVID DV AMT SEX WT ETN $DATA ../../../../extdata/acop.csv
Before submitting a model, read in the data and add a row number column;
library(dplyr) data <- nm_data(.mod) %>% mutate(NUM = 1:n()) readr::write_csv(data, get_data_path(.mod))
Then add 'NUM'
to the list of input columns:
$INPUT ID TIME MDV EVID DV AMT SEX WT ETN *NUM*
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.