setSpecies applies given values to species of the model depending on the key argument.

setSpecies(
  key = NULL,
  name = NULL,
  compartment = NULL,
  type = NULL,
  initial_concentration = NULL,
  initial_number = NULL,
  initial_expression = NULL,
  expression = NULL,
  data = NULL,
  model = getCurrentModel()
)

Arguments

key

Identify which species to edit by specifying it's key, as string. Also supports fragments of keys, if uniquely matching one species.

name

Name to set, as string.

compartment

Key of new compartment to set, as string.

type

Type ("fixed", "assignment", "reactions", "ode") to set, as string.

initial_concentration

Initial concentration to set, as numeric.

initial_number

Initial particle number to set, as numeric.

initial_expression

Initial expression to set, as string, finite numeric, or logical.

expression

Expression to set, as string, finite numeric, or logical.

data

A data frame as given by getSpecies which will be applied before the other arguments.

model

A model object.

Details

Use the key argument to specify which species to modify and any of the other arguments to specify the value to set. The function is fully vectorized. If a NA value is supplied, the model value is kept unchanged.

The online article on managing model entities provides some further context.