makeLaw                package:SBMLR                R Documentation

_G_e_n_e_r_a_t_e _a_n _R _f_u_n_c_t_i_o_n _f_o_r _t_h_e _r_e_a_c_t_i_o_n _r_a_t_e _l_a_w

_D_e_s_c_r_i_p_t_i_o_n:

     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.

_U_s_a_g_e:

     makeLaw(r,p,e)

_A_r_g_u_m_e_n_t_s:

       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. 

_D_e_t_a_i_l_s:

_V_a_l_u_e:

     An R function that returns the value of 'e' given 'r' and 'p',
     e.g. a rate law.

_N_o_t_e:

     This function is also used for rules with p=NULL. It is used by 
     'readSBML' and 'readSBMLR'.

_A_u_t_h_o_r(_s):

     Tomas Radivoyevitch  (radivot@hal.cwru.edu)

_E_x_a_m_p_l_e_s:

     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.

