diff --git a/man/rmdhunks/rxode2-create-models.Rmd b/man/rmdhunks/rxode2-create-models.Rmd index d71ccf870..17e6c3fdf 100644 --- a/man/rmdhunks/rxode2-create-models.Rmd +++ b/man/rmdhunks/rxode2-create-models.Rmd @@ -1,8 +1,8 @@ -The ODE-based model specification may be coded inside four places: +The ODE-based model specification may be coded inside four places: - Inside a `rxode2({})` block statements: -```{r modBracket} +``` r library(rxode2) mod <- rxode2({ # simple assignment @@ -15,7 +15,7 @@ mod <- rxode2({ - Inside a `rxode2("")` string statement: -```{r modString} +``` r mod <- rxode2(" # simple assignment C2 <- centr/V2 @@ -27,7 +27,7 @@ mod <- rxode2(" - In a file name to be loaded by rxode2: -```{r modFile} +``` r writeLines(" # simple assignment C2 <- centr/V2 @@ -38,10 +38,10 @@ writeLines(" mod <- rxode2(filename='modelFile.rxode2') unlink("modelFile.rxode2") ``` - + - In a model function which can be parsed by `rxode2`: -```{r modFun} +``` r mod <- function() { model({ # simple assignment @@ -94,10 +94,10 @@ For the last type of model (a model function), a call to `rxode2` creates a parsed `rxode2` ui that can be translated to the `rxode2` compilation model. -```{r} +``` r mod$simulationModel -# or +# or mod$simulationIniModel ``` diff --git a/vignettes/rxode2-syntax.Rmd b/vignettes/rxode2-syntax.Rmd index 3583a590f..d356a8394 100644 --- a/vignettes/rxode2-syntax.Rmd +++ b/vignettes/rxode2-syntax.Rmd @@ -17,7 +17,7 @@ knitr::opts_chunk$set( ## Introduction -This briefly describes the syntax used to define models +This briefly describes the syntax used to define models that `rxode2` will translate into R-callable compiled code. It also describes the communication of variables between `R` and the `rxode2` modeling specification. @@ -35,7 +35,7 @@ describes the communication of variables between `R` and the ## Bugs and/or deficiencies -- The modulo operator `%%` is currently unsupported. +- The modulo operator `%%` is currently unsupported. ## Note @@ -49,10 +49,10 @@ Below is a commented example to quickly show the capabilities of ## Example -```{r} +``` r f <- function() { ini({ - + }) model({ # An rxode2 model specification (this line is a comment). @@ -86,18 +86,18 @@ via the `d/dt(identifier)` operator as part of the model specification, and which are model parameters via the `params=` argument in `rxode2` `solve()` method: -``` +``` r m1 <- rxode2(model = ode, modName = "m1") # model parameters -- a named vector is required -theta <- +theta <- c(KA=0.29, CL=18.6, V2=40.2, Q=10.5, V3=297, Kin=1, Kout=1, EC50=200) # state variables and their amounts at time 0 (the use of names is # encouraged, but not required) inits <- c(depot=0, centr=0, peri=0, eff=1) -# qd1 is an eventTable specification with a set of dosing and sampling +# qd1 is an eventTable specification with a set of dosing and sampling # records (code not shown here) solve(theta, event = qd1, inits = inits)