modelExtract {rxode2} | R Documentation |
Extract model lines from a rxui model
Description
Extract model lines from a rxui model
Usage
modelExtract(
x,
...,
expression = FALSE,
endpoint = FALSE,
lines = FALSE,
envir = parent.frame()
)
## S3 method for class ''function''
modelExtract(
x,
...,
expression = FALSE,
endpoint = FALSE,
lines = FALSE,
envir = parent.frame()
)
## S3 method for class 'rxUi'
modelExtract(
x,
...,
expression = FALSE,
endpoint = FALSE,
lines = FALSE,
envir = parent.frame()
)
## S3 method for class 'rxode2'
modelExtract(
x,
...,
expression = FALSE,
endpoint = FALSE,
lines = FALSE,
envir = parent.frame()
)
## S3 method for class 'rxModelVars'
modelExtract(
x,
...,
expression = FALSE,
endpoint = FALSE,
lines = FALSE,
envir = parent.frame()
)
## Default S3 method:
modelExtract(
x,
...,
expression = FALSE,
endpoint = FALSE,
lines = FALSE,
envir = parent.frame()
)
Arguments
x |
model to extract lines from |
... |
variables to extract. When it is missing, it will extract the entire model (conditioned on the endpoint option below) |
expression |
return expressions (if |
endpoint |
include endpoint. This can be:
|
lines |
is a boolean. When |
envir |
Environment for evaluating variables |
Value
expressions or strings of extracted lines. Note if there is a duplicated lhs expression in the line, it will return both lines
Author(s)
Matthew L. Fidler
Examples
one.compartment <- function() {
ini({
tka <- 0.45 # Log Ka
tcl <- 1 # Log Cl
tv <- 3.45 # Log V
eta.ka ~ 0.6
eta.cl ~ 0.3
eta.v ~ 0.1
add.sd <- 0.7
})
model({
ka <- exp(tka + eta.ka)
cl <- exp(tcl + eta.cl)
v <- exp(tv + eta.v)
d/dt(depot) <- -ka * depot
d/dt(center) <- ka * depot - cl / v * center
cp <- center / v
cp ~ add(add.sd)
})
}
f <- one.compartment()
modelExtract(f, cp)
modelExtract(one.compartment, d/dt(depot))
# from variable
var <- "d/dt(depot)"
modelExtract(one.compartment, var)
modelExtract(f, endpoint=NA, lines=TRUE, expression=TRUE)
[Package rxode2 version 2.1.3 Index]