New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow simulation from completely empty time grid #648
Comments
library(mrgsolve)
#>
#> Attaching package: 'mrgsolve'
#> The following object is masked from 'package:stats':
#>
#> filter
mod <- house(end = 24)
dose <- ev(amt = 0, ii = 1, addl = 4,evid=2) %>% realize_addl()
dose
#> Events:
#> time amt ii addl cmt evid
#> 1 0 0 0 0 1 2
#> 2 1 0 0 0 1 2
#> 3 2 0 0 0 1 2
#> 4 3 0 0 0 1 2
#> 5 4 0 0 0 1 2
mod %>% mrgsim(ev = dose, end = -1)
#> Model: housemodel
#> Dim: 6 x 7
#> Time: 0 to 4
#> ID: 1
#> ID time GUT CENT RESP DV CP
#> 1: 1 0 0 0 50 0 0
#> 2: 1 0 0 0 50 0 0
#> 3: 1 1 0 0 50 0 0
#> 4: 1 2 0 0 50 0 0
#> 5: 1 3 0 0 50 0 0
#> 6: 1 4 0 0 50 0 0 Created on 2020-03-14 by the reprex package (v0.3.0) |
library(mrgsolve)
#>
#> Attaching package: 'mrgsolve'
#> The following object is masked from 'package:stats':
#>
#> filter
mod <- house(end = 24)
dose <- ev(amt = 0, ii = 1, addl = 4,evid=2) %>% realize_addl()
dose
#> Events:
#> time amt ii addl cmt evid
#> 1 0 0 0 0 1 2
#> 2 1 0 0 0 1 2
#> 3 2 0 0 0 1 2
#> 4 3 0 0 0 1 2
#> 5 4 0 0 0 1 2
mod %>% mrgsim(ev = dose, end = -1)
#> Model: housemodel
#> Dim: 5 x 7
#> Time: 0 to 4
#> ID: 1
#> ID time GUT CENT RESP DV CP
#> 1: 1 0 0 0 50 0 0
#> 2: 1 1 0 0 50 0 0
#> 3: 1 2 0 0 50 0 0
#> 4: 1 3 0 0 50 0 0
#> 5: 1 4 0 0 50 0 0 Created on 2020-03-14 by the reprex package (v0.3.0) |
Fixed tests in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
0
when there are not times (add isnumeric(0)
and end is-1
. That was originally done for safety, but it really isn't the behavior we want in certain casesSOLUTION:
render_time
so that it is more efficient and can returnnumeric(0)
if there are really no timesTests
The text was updated successfully, but these errors were encountered: