CAB.extract: Extract parts of a 'CAB.model organism' slot

Description Usage Arguments Value Note See Also Examples

Description

An extraction method is implemented for the CAB.model object for extracting objects from the organism slot. For assignment to the organism slot, see o_set.

Usage

1
x[v]

Arguments

x

A CAB.model object.

v

String specifying a variable in the organism slot of x. Must be a named argument.

Value

The object in the organism slot of the specified CAB.model object.

Note

Further indexing of the returend object can be done with additional use of the [ function.

See Also

o_set for assignment

Examples

1
2
3
4
5
6
7
8
9
# Using the good_times_model from class.CAB.models
good_times_model

# Get the value of happiness_level
good_times_model[ v = "happiness_level" ]
# Second level indexing. Returns the same thing
good_times_model[ v = "happiness_level" ][1]
Out of range:
good_times_model[ v = "happiness_level" ][2]

Don-Li/CAB documentation built on May 6, 2019, 2:52 p.m.