nm_join_sim | R Documentation |
Joins the simulation and input data of a bbi_nonmem_model
object with an
attached simulation.
nm_join_sim(
.mod,
.join_col = "NUM",
.cols_keep = "all",
add_table_names = FALSE
)
.mod |
A |
.join_col |
Character column name(s) to use to join table files.
Defaults to |
.cols_keep |
Either |
add_table_names |
Logical (T/F). If |
a tibble
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.
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*
The join column name(s) specified should match what you provided to
add_simulation()
.
add_simulation()
, nm_file_multi_tab()
, nm_tables()
## Not run:
add_simulation(.mod, .join_col = c("NUM", "ID"))
nm_join_sim(.mod, .join_col = c("NUM", "ID"), .cols_keep = "ID")
# These return the same thing (simulation model is automatically read-in):
nm_join_sim(.mod)
nm_join_sim(get_simulation(.mod))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.