Replace: Replace an existing Stock, Fleet, Obs, or Imp object

Description Usage Arguments Value Note Author(s) Examples

View source: R/OM_functions.R

Description

A function that replaces a Stock, Fleet, Obs, or Imp object from an OM with one from another object.

Usage

1
2
3
4
5
6
7
Replace(
  OM,
  from,
  Sub = c("Stock", "Fleet", "Obs", "Imp"),
  Name = NULL,
  silent = FALSE
)

Arguments

OM

An operating model object (class OM) which will be updated with a sub-model from another OM

from

An object of class OM, Stock, Fleet, Obs, or Imp to be replace the values in OM

Sub

A character string specifying what object type to replace (only used if from is class OM) "Stock", "Fleet", "Obs", or "Imp" (default is all four which is probably not what you want to do)

Name

Character. Name for the new OM object (OM@Name)

silent

Should messages be printed?

Value

An object of class OM

Note

See relevant section of the DLMtool User Guide for more information.

Author(s)

A. Hordyk

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Replace Stock 
OM <- DLMtool::testOM
OM2 <- Replace(OM, Blue_shark)

# Replace Fleet 
OM <- DLMtool::testOM
OM2 <- Replace(OM, Generic_DecE)

# Replace Fleet from another OM 
OM1 <- new("OM", Albacore, Generic_DecE, Perfect_Info, Overages)
OM2 <- new("OM", Blue_shark, Generic_IncE, Generic_Obs, Perfect_Imp)
OM1a <- Replace(OM1, OM2, "Fleet")

DLMtool/DLMtool documentation built on June 20, 2021, 5:20 p.m.