nlmixr2 / rxode2et

https://nlmixr2.github.io/rxode2et/
1 stars 1 forks source link

`et()` adds a dose that was not specified #2

Closed billdenney closed 1 year ago

billdenney commented 2 years ago

When running et() to add observations, it adds the dose for a new id that was not requested. (See the dose that exists for id=3 but was specifically not requested in the original et() call.)

library(magrittr)
rxode2::et(amt=10, id=1:2) %>% rxode2::et(time=1, id=2:3)
#> ── EventTable with 5 records ──
#> 3 dosing records (see x$get.dosing(); add with add.dosing or et)
#> 2 observation times (see x$get.sampling(); add with add.sampling or et)
#> ── First part of x: ──
#> # A tibble: 5 × 4
#>      id  time   amt evid         
#>   <int> <dbl> <dbl> <evid>       
#> 1     1     0    10 1:Dose (Add) 
#> 2     2     0    10 1:Dose (Add) 
#> 3     2     1    NA 0:Observation
#> 4     3     0    10 1:Dose (Add) 
#> 5     3     1    NA 0:Observation

Created on 2022-10-01 with reprex v2.0.2