drop.Rd
Drops multiple surveys or age groups from an FLSAM.control object
drop.from.control(object, fleets="missing",ages="missing")
An FLSAM.control
object
A vector containing the names of the fleets to be dropped
A vector containing the names of the age groups to be dropped
This function can be used to modify an FLSAM.control
object by removing one or more fleets, or one or more age groups from the object. Changes in the sequence of bindings that may arise due to the removal of a fleet or age group are corrected for using the update
function.
An FLSAM.control object
#Load assessment
library(FLSAM)
data(NSH)
#NSH.ctrl before dropping
NSH.ctrl
#> An object of class "FLSAM.control"
#> Slot "name":
#> [1] "North Sea Herring"
#>
#> Slot "desc":
#> [1] "Imported from a VPA file. ( ./data/index.txt ). Fri May 4 12:16:13 2012 + FLSAM: North Sea Herring"
#>
#> Slot "range":
#> min max plusgroup minyear maxyear minfbar maxfbar
#> 0 8 8 1992 2012 2 6
#>
#> Slot "fleets":
#> catch unique SCAI HERAS IBTS-Q1 IBTS0
#> 0 3 2 2 2
#>
#> Slot "plus.group":
#> plusgroup
#> TRUE
#>
#> Slot "states":
#> age
#> fleet 0 1 2 3 4 5 6 7 8
#> catch unique 0 1 2 3 4 5 6 7 7
#> SCAI -1 -1 -1 -1 -1 -1 -1 -1 -1
#> HERAS -1 -1 -1 -1 -1 -1 -1 -1 -1
#> IBTS-Q1 -1 -1 -1 -1 -1 -1 -1 -1 -1
#> IBTS0 -1 -1 -1 -1 -1 -1 -1 -1 -1
#>
#> Slot "logN.vars":
#> 0 1 2 3 4 5 6 7 8
#> 0 1 1 1 1 1 1 1 1
#>
#> Slot "logP.vars":
#> numeric(0)
#>
#> Slot "catchabilities":
#> age
#> fleet 0 1 2 3 4 5 6 7 8
#> catch unique -1 -1 -1 -1 -1 -1 -1 -1 -1
#> SCAI 0 -1 -1 -1 -1 -1 -1 -1 -1
#> HERAS -1 1 2 3 4 5 6 7 7
#> IBTS-Q1 -1 8 -1 -1 -1 -1 -1 -1 -1
#> IBTS0 9 -1 -1 -1 -1 -1 -1 -1 -1
#>
#> Slot "power.law.exps":
#> age
#> fleet 0 1 2 3 4 5 6 7 8
#> catch unique -1 -1 -1 -1 -1 -1 -1 -1 -1
#> SCAI -1 -1 -1 -1 -1 -1 -1 -1 -1
#> HERAS -1 -1 -1 -1 -1 -1 -1 -1 -1
#> IBTS-Q1 -1 -1 -1 -1 -1 -1 -1 -1 -1
#> IBTS0 -1 -1 -1 -1 -1 -1 -1 -1 -1
#>
#> Slot "f.vars":
#> age
#> fleet 0 1 2 3 4 5 6 7 8
#> catch unique 0 0 0 0 0 0 0 0 0
#> SCAI -1 -1 -1 -1 -1 -1 -1 -1 -1
#> HERAS -1 -1 -1 -1 -1 -1 -1 -1 -1
#> IBTS-Q1 -1 -1 -1 -1 -1 -1 -1 -1 -1
#> IBTS0 -1 -1 -1 -1 -1 -1 -1 -1 -1
#>
#> Slot "obs.vars":
#> age
#> fleet 0 1 2 3 4 5 6 7 8
#> catch unique 0 0 0 0 0 0 0 0 0
#> SCAI 1 -1 -1 -1 -1 -1 -1 -1 -1
#> HERAS -1 2 2 2 2 2 2 2 2
#> IBTS-Q1 -1 3 -1 -1 -1 -1 -1 -1 -1
#> IBTS0 4 -1 -1 -1 -1 -1 -1 -1 -1
#>
#> Slot "srr":
#> [1] 0
#>
#> Slot "scaleNoYears":
#> [1] 0
#>
#> Slot "scaleYears":
#> [1] NA
#>
#> Slot "scalePars":
#> age
#> years 0 1 2 3 4 5 6 7 8
#>
#> Slot "cor.F":
#> [1] 2
#>
#> Slot "cor.obs":
#> age
#> fleet 0-1 1-2 2-3 3-4 4-5 5-6 6-7 7-8
#> catch unique NA NA NA NA NA NA NA NA
#> SCAI -1 -1 -1 -1 -1 -1 -1 -1
#> HERAS -1 NA NA NA NA NA NA NA
#> IBTS-Q1 -1 -1 -1 -1 -1 -1 -1 -1
#> IBTS0 -1 -1 -1 -1 -1 -1 -1 -1
#>
#> Slot "cor.obs.Flag":
#> [1] ID ID ID ID ID
#> Levels: ID AR US
#>
#> Slot "biomassTreat":
#> [1] -1 0 -1 -1 -1
#>
#> Slot "timeout":
#> [1] 3600
#>
#> Slot "likFlag":
#> [1] LN LN LN LN LN
#> Levels: LN ALN
#>
#> Slot "fixVarToWeight":
#> [1] FALSE
#>
#> Slot "simulate":
#> [1] FALSE
#>
#> Slot "residuals":
#> [1] TRUE
#>
#> Slot "sumFleets":
#> logical(0)
#>
#Drop MLAI index
drop.from.control(NSH.ctrl,fleets="MLAI")
#> An object of class "FLSAM.control"
#> Slot "name":
#> [1] "North Sea Herring"
#>
#> Slot "desc":
#> [1] "Imported from a VPA file. ( ./data/index.txt ). Fri May 4 12:16:13 2012 + FLSAM: North Sea Herring"
#>
#> Slot "range":
#> min max plusgroup minyear maxyear minfbar maxfbar
#> 0 8 8 1992 2012 2 6
#>
#> Slot "fleets":
#> catch unique SCAI HERAS IBTS-Q1 IBTS0
#> 0 3 2 2 2
#>
#> Slot "plus.group":
#> plusgroup
#> TRUE
#>
#> Slot "states":
#> age
#> fleet 0 1 2 3 4 5 6 7 8
#> catch unique 0 1 2 3 4 5 6 7 7
#> SCAI -1 -1 -1 -1 -1 -1 -1 -1 -1
#> HERAS -1 -1 -1 -1 -1 -1 -1 -1 -1
#> IBTS-Q1 -1 -1 -1 -1 -1 -1 -1 -1 -1
#> IBTS0 -1 -1 -1 -1 -1 -1 -1 -1 -1
#>
#> Slot "logN.vars":
#> 0 1 2 3 4 5 6 7 8
#> 0 1 1 1 1 1 1 1 1
#>
#> Slot "logP.vars":
#> numeric(0)
#>
#> Slot "catchabilities":
#> age
#> fleet 0 1 2 3 4 5 6 7 8
#> catch unique -1 -1 -1 -1 -1 -1 -1 -1 -1
#> SCAI 0 -1 -1 -1 -1 -1 -1 -1 -1
#> HERAS -1 1 2 3 4 5 6 7 7
#> IBTS-Q1 -1 8 -1 -1 -1 -1 -1 -1 -1
#> IBTS0 9 -1 -1 -1 -1 -1 -1 -1 -1
#>
#> Slot "power.law.exps":
#> age
#> fleet 0 1 2 3 4 5 6 7 8
#> catch unique -1 -1 -1 -1 -1 -1 -1 -1 -1
#> SCAI -1 -1 -1 -1 -1 -1 -1 -1 -1
#> HERAS -1 -1 -1 -1 -1 -1 -1 -1 -1
#> IBTS-Q1 -1 -1 -1 -1 -1 -1 -1 -1 -1
#> IBTS0 -1 -1 -1 -1 -1 -1 -1 -1 -1
#>
#> Slot "f.vars":
#> age
#> fleet 0 1 2 3 4 5 6 7 8
#> catch unique 0 0 0 0 0 0 0 0 0
#> SCAI -1 -1 -1 -1 -1 -1 -1 -1 -1
#> HERAS -1 -1 -1 -1 -1 -1 -1 -1 -1
#> IBTS-Q1 -1 -1 -1 -1 -1 -1 -1 -1 -1
#> IBTS0 -1 -1 -1 -1 -1 -1 -1 -1 -1
#>
#> Slot "obs.vars":
#> age
#> fleet 0 1 2 3 4 5 6 7 8
#> catch unique 0 0 0 0 0 0 0 0 0
#> SCAI 1 -1 -1 -1 -1 -1 -1 -1 -1
#> HERAS -1 2 2 2 2 2 2 2 2
#> IBTS-Q1 -1 3 -1 -1 -1 -1 -1 -1 -1
#> IBTS0 4 -1 -1 -1 -1 -1 -1 -1 -1
#>
#> Slot "srr":
#> [1] 0
#>
#> Slot "scaleNoYears":
#> [1] 0
#>
#> Slot "scaleYears":
#> [1] NA
#>
#> Slot "scalePars":
#> age
#> years 0 1 2 3 4 5 6 7 8
#>
#> Slot "cor.F":
#> [1] 2
#>
#> Slot "cor.obs":
#> age
#> fleet 0-1 1-2 2-3 3-4 4-5 5-6 6-7 7-8
#> catch unique NA NA NA NA NA NA NA NA
#> SCAI -1 -1 -1 -1 -1 -1 -1 -1
#> HERAS -1 NA NA NA NA NA NA NA
#> IBTS-Q1 -1 -1 -1 -1 -1 -1 -1 -1
#> IBTS0 -1 -1 -1 -1 -1 -1 -1 -1
#>
#> Slot "cor.obs.Flag":
#> factor(0)
#> Levels: ID AR US
#>
#> Slot "biomassTreat":
#> numeric(0)
#>
#> Slot "timeout":
#> [1] 3600
#>
#> Slot "likFlag":
#> factor(0)
#> Levels: LN ALN
#>
#> Slot "fixVarToWeight":
#> [1] FALSE
#>
#> Slot "simulate":
#> [1] FALSE
#>
#> Slot "residuals":
#> [1] TRUE
#>
#> Slot "sumFleets":
#> logical(0)
#>
#Drop ages 8 and 9
drop.from.control(NSH.ctrl,ages=8:9)
#> An object of class "FLSAM.control"
#> Slot "name":
#> [1] "North Sea Herring"
#>
#> Slot "desc":
#> [1] "Imported from a VPA file. ( ./data/index.txt ). Fri May 4 12:16:13 2012 + FLSAM: North Sea Herring"
#>
#> Slot "range":
#> min max plusgroup minyear maxyear minfbar maxfbar
#> 0 8 8 1992 2012 2 6
#>
#> Slot "fleets":
#> catch unique SCAI HERAS IBTS-Q1 IBTS0
#> 0 3 2 2 2
#>
#> Slot "plus.group":
#> plusgroup
#> TRUE
#>
#> Slot "states":
#> age
#> fleet 0 1 2 3 4 5 6 7
#> catch unique 0 1 2 3 4 5 6 7
#> SCAI -1 -1 -1 -1 -1 -1 -1 -1
#> HERAS -1 -1 -1 -1 -1 -1 -1 -1
#> IBTS-Q1 -1 -1 -1 -1 -1 -1 -1 -1
#> IBTS0 -1 -1 -1 -1 -1 -1 -1 -1
#>
#> Slot "logN.vars":
#> 0 1 2 3 4 5 6 7
#> 0 1 1 1 1 1 1 1
#>
#> Slot "logP.vars":
#> numeric(0)
#>
#> Slot "catchabilities":
#> age
#> fleet 0 1 2 3 4 5 6 7
#> catch unique -1 -1 -1 -1 -1 -1 -1 -1
#> SCAI 0 -1 -1 -1 -1 -1 -1 -1
#> HERAS -1 1 2 3 4 5 6 7
#> IBTS-Q1 -1 8 -1 -1 -1 -1 -1 -1
#> IBTS0 9 -1 -1 -1 -1 -1 -1 -1
#>
#> Slot "power.law.exps":
#> age
#> fleet 0 1 2 3 4 5 6 7
#> catch unique -1 -1 -1 -1 -1 -1 -1 -1
#> SCAI -1 -1 -1 -1 -1 -1 -1 -1
#> HERAS -1 -1 -1 -1 -1 -1 -1 -1
#> IBTS-Q1 -1 -1 -1 -1 -1 -1 -1 -1
#> IBTS0 -1 -1 -1 -1 -1 -1 -1 -1
#>
#> Slot "f.vars":
#> age
#> fleet 0 1 2 3 4 5 6 7
#> catch unique 0 0 0 0 0 0 0 0
#> SCAI -1 -1 -1 -1 -1 -1 -1 -1
#> HERAS -1 -1 -1 -1 -1 -1 -1 -1
#> IBTS-Q1 -1 -1 -1 -1 -1 -1 -1 -1
#> IBTS0 -1 -1 -1 -1 -1 -1 -1 -1
#>
#> Slot "obs.vars":
#> age
#> fleet 0 1 2 3 4 5 6 7
#> catch unique 0 0 0 0 0 0 0 0
#> SCAI 1 -1 -1 -1 -1 -1 -1 -1
#> HERAS -1 2 2 2 2 2 2 2
#> IBTS-Q1 -1 3 -1 -1 -1 -1 -1 -1
#> IBTS0 4 -1 -1 -1 -1 -1 -1 -1
#>
#> Slot "srr":
#> [1] 0
#>
#> Slot "scaleNoYears":
#> [1] 0
#>
#> Slot "scaleYears":
#> [1] NA
#>
#> Slot "scalePars":
#> age
#> years 0 1 2 3 4 5 6 7
#>
#> Slot "cor.F":
#> [1] 2
#>
#> Slot "cor.obs":
#> age
#> fleet 0-1 1-2 2-3 3-4 4-5 5-6 6-7
#> catch unique NA NA NA NA NA NA NA
#> SCAI -1 -1 -1 -1 -1 -1 -1
#> HERAS -1 NA NA NA NA NA NA
#> IBTS-Q1 -1 -1 -1 -1 -1 -1 -1
#> IBTS0 -1 -1 -1 -1 -1 -1 -1
#>
#> Slot "cor.obs.Flag":
#> [1] ID ID ID ID ID
#> Levels: ID AR US
#>
#> Slot "biomassTreat":
#> [1] -1 0 -1 -1 -1
#>
#> Slot "timeout":
#> [1] 3600
#>
#> Slot "likFlag":
#> [1] LN LN LN LN LN
#> Levels: LN ALN
#>
#> Slot "fixVarToWeight":
#> [1] FALSE
#>
#> Slot "simulate":
#> [1] FALSE
#>
#> Slot "residuals":
#> [1] TRUE
#>
#> Slot "sumFleets":
#> logical(0)
#>