Learn R Programming

sybil (version 2.2.0)

changeObjFunc: Sets/changes the Objective Function

Description

The function changeObjFunc changes or sets the objective function for a specified model.

Usage

changeObjFunc(model, react, obj_coef = rep(1, length(react)))

Arguments

model

An object of class '>modelorg.

react

An object of class '>reactId, character or integer. Specifies the fluxes (variables) for which to change the objective coefficients.

obj_coef

A numerical vector with length equal to the number of reaction id's given in argument react containing the objective coefficients. Default: a value of one for each reaction given in argument react.

Value

Returns the given model containing the new objective function.

Details

The argument react will be evaluated by the function checkReactId. The return value is used to change the objective function.

All reactions not given in argument react will get an objective value of zero.

See Also

checkReactId

Examples

Run this code
# NOT RUN {
  ## sets the objective function to the ATP maintenance reaction:
  data(Ec_core)
  Ec_new <- changeObjFunc(Ec_core, "ATPM")
# }

Run the code above in your browser using DataLab