genCovFun | R Documentation |
This function is really useful bu this and a few other may belong better in a simulation package.
genCovFun(
NMcode0,
pars0,
covs0,
theta0,
omega0,
name.fun,
verbose = F,
debug = F
)
NMcode0 |
Nonmem code that translates THETA and OMEGA into PK/PD parameters like CL, V2, EMAX etc. |
pars0 |
The names of the final individual parameters that the generated function must return and which can be used for simulations. |
covs0 |
Names of covariates which are arguments to the generated function. |
theta0 |
default theta for resulting function. See details. |
omega0 |
default omega for resulting function. See details. |
name.fun |
The name of the function to be generated. |
verbose |
print the resulting function to the terminal? Default is FALSE. |
debug |
Start by calling browser()? |
The function returns a function in plain text. If you want to store the code, paste this text to a file. If you want to use it right away, do fun1text <- genCovFun() newfun <- eval(parse(text=fun1text))
The resulting function takes arguments theta and omega.
A character string which can be evaluated to create a function.
Other Simulation:
NMcode2R()
## Not run:
text0 <- NMdata::NMgetSection(file="run1.lst",section="PK",return="text",
keepName=FALSE,cleanSpaces=FALSE)
NMR0 <- NMcode2R(text0)
## get rid of some text that has nothing to do with covariates
NMR1 <- NMR0[-c(1:21)]
NMR2 <- NMR1[1:25]
pars <- extload(paste0(run,".ext"))
fun1text <- genCovFun(NMcode0=NMR3
,pars0=c("KA","DCL","V2","V3","Q","D1","F1","CL0","KCL")
,theta0=pars$theta
,omega0=pars$omega
,name.fun="parsBase"
## ,debug=T
)
cat(fun1text)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.