makeLaw {SBMLR} | R Documentation |
This function creates an R function for a rate law given three arguments, the inputs variable, the parameters, and the rate law as an R expression.
makeLaw(r,p,e)
r |
A vector of the reactant and modulator names. |
p |
A named numeric vector of the function's local parameters. |
e |
An R expression (i.e. nested calls and tokens) of the reaction rate law. |
An R function that returns the value of e
given r
and p
, e.g. a rate law.
This function is also used for rules with p=NULL. It is used by
readSBML
and readSBMLR
.
Tomas Radivoyevitch (radivot@hal.cwru.edu)
library(SBMLR) curto=readSBMLR(file.path(system.file(package="SBMLR"), "models/curto.r")) curto$reactions[["ada"]] e=curto$reactions[["ada"]]$exprLaw;e r=curto$reactions[["ada"]]$reactants;r m=curto$reactions[["ada"]]$modifiers;m r=c(r,m) p=curto$reactions[["ada"]]$parameters;p makeLaw(r,p,e) ## compare to curto$reactions[["ada"]]$law ## indeed, above is how $law functions are now made, and in part why readSBMLR has replaced source.