Closed frbrz closed 1 year ago
Thanks; We will have a look.
Note that if you don't specify evid=0
the piping also works
library(rxode2)
#> rxode2 2.0.7 using 4 threads (see ?getRxThreads)
#> no cache: create with `rxCreateCache()`
et(amt = 10, cmt = 1, time = 0, evid = 1, id = 1) %>%
et(time = c(0, 10, 20))
#> ── EventTable with 4 records ──
#> 1 dosing records (see x$get.dosing(); add with add.dosing or et)
#> 3 observation times (see x$get.sampling(); add with add.sampling or et)
#> ── First part of x: ──
#> # A tibble: 4 × 5
#> id time cmt amt evid
#> <int> <dbl> <int> <dbl> <evid>
#> 1 1 0 NA NA 0:Observation
#> 2 1 0 1 10 1:Dose (Add)
#> 3 1 10 NA NA 0:Observation
#> 4 1 20 NA NA 0:Observation
Created on 2022-10-12 with reprex v2.0.2
FYI, this is fixed with the GitHub version:
# remotes::install_github("nlmixr2/rxode2et")
library(rxode2et)
et(time = c(0, 10, 20), evid = 0)
#> ── EventTable with 3 records ──
#> 0 dosing records (see x$get.dosing(); add with add.dosing or et)
#> 3 observation times (see x$get.sampling(); add with add.sampling or et)
#> ── First part of x: ──
#> # A tibble: 3 × 2
#> time evid
#> <dbl> <evid>
#> 1 0 0:Observation
#> 2 10 0:Observation
#> 3 20 0:Observation
Created on 2022-10-25 with reprex v2.0.2
Hi,
Thanks for the great package!
I may have caught an unexpected behavior with et() and piping. See the minimal example below Basically I get an error saying that I cannot use zero
evid
with amt when piping dosing and observation information. Theamt
specification is not with evid = 0, but comes from the pipe with evid = 1. A quick fix is usingadd.sampling()
instead of et(..., evid = 0). Definitely a low fix priority, but you may want to have a look.Thanks a lot!