Skip to contents

A method to generate observations of abundance at age.

Usage

survey(object, index, ...)

# S4 method for FLStock,FLIndex
survey(
  object,
  index,
  sel = sel.pattern(index),
  ages = dimnames(index)$age,
  timing = mean(range(index, c("startf", "endf"))),
  index.q = index@index.q,
  stability = 1
)

# S4 method for FLStock,FLIndexBiomass
survey(
  object,
  index,
  sel = sel.pattern(index),
  ages = ac(seq(range(index, c("min")), range(index, c("max")))),
  timing = mean(range(index, c("startf", "endf"))),
  catch.wt = stock.wt(object)[, dimnames(index)$year],
  index.q = index@index.q,
  stability = 1
)

# S4 method for FLStock,missing
survey(
  object,
  sel = catch.sel(object),
  ages = dimnames(sel)$age,
  timing = 0.5,
  index.q = 1,
  biomass = FALSE,
  stability = 1
)

# S4 method for FLStock,FLIndices
survey(object, index, ...)

Arguments

object

The object on which to draw the observation

Value

An FLQuant for the index of abundance

See also

Author

The FLR Team

Examples

data(ple4)
data(ple4.index)
# CONSTRUCT a survey from stock and index
survey(ple4, ple4.index)
#> An object of class "FLIndex"
#> 
#> Name: BTS-Combined (all) 
#> Description: Plaice in IV											 . Imported from VPA file. 
#> Type :  numbers 
#> Distribution :   
#> Quant: age 
#> Dims:  age 	year	unit	season	area	iter
#> 	10	22	1	1	1	1	
#> 
#> Range:  min	max	pgroup	minyear	maxyear	startf	endf 
#> 	1	10	1	1996	2017	0.6453376	0.6453376	
#> 
# Create FLIndexBiomass
ple4.biom <- as(ple4.index, "FLIndexBiomass")
survey(ple4, ple4.biom)
#> An object of class "FLIndexBiomass"
#> 
#> Name: BTS-Combined (all) 
#> Description: Plaice in IV											 . Imported from VPA file. 
#> Distribution :   
#> Quant: age 
#> Dims:  age 	year	unit	season	area	iter
#> 	10	22	1	1	1	1	
#> 
#> Range:  min	max	pgroup	minyear	maxyear	startf	endf 
#> 	1	10	1	1996	2017	0.6453376	0.6453376	
#> 
data(ple4)
survey(ple4)
#> An object of class "FLIndex"
#> 
#> Name:  
#> Description:  
#> Type :  number 
#> Distribution :   
#> Quant: age 
#> Dims:  age 	year	unit	season	area	iter
#> 	10	61	1	1	1	1	
#> 
#> Range:  min	max	pgroup	minyear	maxyear	startf	endf 
#> 	1	10	10	1957	2017	0.5	0.5	
#> 
survey(ple4, biomass=TRUE)
#> An object of class "FLIndexBiomass"
#> 
#> Name:  
#> Description:  
#> Distribution :   
#> Quant: age 
#> Dims:  age 	year	unit	season	area	iter
#> 	10	61	1	1	1	1	
#> 
#> Range:  min	max	pgroup	minyear	maxyear	startf	endf 
#> 	1	10	10	1957	2017	0.5	0.5	
#>