Declares the compartment of a state, before or after the state
is introduced by addReaction().
Arguments
- eqnlist
object of class eqnlist
- ...
named arguments
state = "compartment", or a single named character vector of the same shape. Compartments that do not exist yet are created with volume"1".- volume
Optional volume expression for the target compartment. Only allowed when
...names a single compartment; usesetCompartmentVolume()for several.- rule
optional volume rule (
dV/dt) for the target compartment, seesetCompartmentVolume(). DefaultNULL.
Value
An object of class eqnlist.
Examples
f <- eqnlist() |>
assignCompartment(TGFb = "extraCell", volume = "V_ext") |>
addReaction("R + TGFb", "R_TGFb", "k_on*R*TGFb", compartment = "Cell")
f$compartmentOf
#> R TGFb R_TGFb
#> "Cell" "extraCell" "Cell"