FLModel {FLCore}R Documentation

Method FLModel

Description

Constructor method for objects of class FLModel-class. This method is to be called by the constructor methods of classes extending FLModel.

An argument class instructs the constructor about the exact class of the returned object. Constructor methods for FLModel-based class should simply invoke this method with the appropriate class argument (See example below).

Generic function

FLModel(object)

Methods

signature(object=formula) :
First argument is a formula describing the model, to be placed in the model slot.
signature(object=missing) :
Arguments, if given, are parsed and allocated by name to a iven slot. If none if provided, and empty FLModel object is returned.
signature(object=function) :
A function returning a list with names equal to one or more of the slots in the class is called, and elements in that list are allocated by name. See SRModels for uses of this mechanism
signature(object=character) :
A function with his name is called, as above.

Author(s)

The FLR Team

See Also

FLComp

Examples

# Normally, FLModel objects won't be created, as class lacks input slots
summary(FLModel(length~width*alpha))

# Objects of FLModel-based classes use their own constructor,
# which internally calls FLModel
fsr <- FLModel(rec~ssb*a, class='FLSR')
is(fsr)
summary(fsr)

# An example constructor method for an FLModel-based class
# create FLGrowth class with a single new slot, 'mass'
setClass('FLGrowth', representation("FLModel",
  mass='FLArray'))

# define creator method, based on FLModel()
setGeneric('FLGrowth', function(object, ...)
                standardGeneric('FLGrowth'))
setMethod('FLGrowth', signature(object='ANY'),
  function(object, ...)
    FLModel(object, class='FLGrowth', ...))


[Package FLCore version 2.2 Index]