| irep | R Documentation |
Add a column containing a simulation counter (irep). A new simulation is counted every time a value in x is different than its previous value and is a duplicate.
xpose fixed this upstream around version 0.5.0, then later reverted that
fix, so this is treated as a standing bugfix rather than a temporary one
pending removal (previously this deferred to xpose::irep() for
xpose >= 0.5.0; that's no longer safe to assume).
This version of the function does not require IDs be ascending, but does not work for
datasets where IDs are repeated (not in sequence). Both cases are read as separate
individuals for NONMEM, but NONMEM does not need to detect repetition of ID sequences (for NONMEM,
1,1,2,2,3,3,1,1,2,2,3,3 is 6 individuals, regardless of being 2 repeats of 3 individuals).
Given the vast majority of datasets use 1 individual per ID, (which cannot be said about IDs
always being ascending), only one of these corrections is implemented.
irep(x, quiet = FALSE)
x |
The column to be used for computing simulation number, usually the ID column. |
quiet |
Logical, if |
Bugfix for irep.
<numeric> vector tracking the number of simulations based on unique subject IDs.
data("xpdb_ex_pk", package = "xpose")
xpdb_ex_pk_2 <- xpdb_ex_pk %>%
mutate(sim_id = irep(ID), .problem = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.