Skip to contents

Select or modify iterations of an FLR object

Usage

iter(obj, ...)

# S4 method for class 'FLArray'
iter(obj, iter)

Details

To extract or modify a subset of the iterations contained in an FLR object, the iter and iter<- methods can be used.

In complex objects with various FLQuant slots, the iter method checks whether individual slots contain more than one iteration, i.e. dims(object)[6] > 1. If a particular slot contains a single iteration, that is returned, otherwise the chosen iteration is selected. This is in contrast with the subset operator [, which does not carry out this check.

For objects of class FLModel, iters are extracted for slots of classes FLQuant, FLCohort and FLPar.

Generic function

iter(object) iter<-(object,value)

See also

Author

The FLR Team

Examples

# For an FLQuant
  flq <- FLQuant(rnorm(800), dim=c(4,10,2), iter=10)
  iter(flq, 2)
#> An x of class "FLQuant"
#> , , unit = 1, season = all, area = unique
#> 
#>      year
#> quant 1        2        3        4        5        6        7        8       
#>     1 -0.50482 -1.33709  0.37986  0.87919 -3.13367 -1.01444  1.54282  2.26082
#>     2 -0.55966 -0.28025 -1.65438 -0.64477  0.96009  0.97114  0.26385  0.20342
#>     3 -1.47481 -0.41858 -0.24334 -0.17507  0.51214  0.69148 -1.01383  0.50840
#>     4  0.11425 -0.19085 -0.06871 -0.03743  0.80315  1.86765 -0.15839 -0.73739
#>      year
#> quant 9        10      
#>     1  0.39936 -1.31375
#>     2  0.38755  0.95332
#>     3  1.24211 -0.00571
#>     4 -0.38551  2.72112
#> 
#> , , unit = 2, season = all, area = unique
#> 
#>      year
#> quant 1        2        3        4        5        6        7        8       
#>     1 -1.25692  0.03304 -1.63871  0.11926 -0.36738 -1.03381 -0.07893  0.08271
#>     2  0.35850  0.78234  0.23223 -0.33334  0.36753 -1.47522  0.56155 -0.30816
#>     3 -1.15555 -0.15534  1.13502  0.10126  1.15770  0.29325 -0.41799  1.79001
#>     4 -0.45119 -0.44061  0.78103  0.28178 -0.94488 -0.01790  1.83266 -0.03467
#>      year
#> quant 9        10      
#>     1 -0.17995 -0.83611
#>     2 -0.07397  0.64703
#>     3  0.88497  0.05570
#>     4 -2.92686  0.45087
#> 
#> units:  NA 
# For the more complex FLStock object
  data(ple4)
  fls <- propagate(ple4, 10)
  # Extraction using iter...
    fls2 <- iter(fls, 2)
    summary(fls2)
#> An object of class "FLStock"
#> 
#> Name: PLE 
#> Description: Plaice in IV. ICES WGNSSK 2018. FLAAP 
#> Quant: age 
#> Dims:  age 	year	unit	season	area	iter
#> 	10	61	1	1	1	1	
#> 
#> Range:  min	max	pgroup	minyear	maxyear	minfbar	maxfbar 
#> 	1	10	10	1957	2017	2	6	
#> 
#> Metrics: 
#>   rec: 367450 - 4303680  (1000) 
#>   ssb: 203391 - 913290  (t) 
#>   catch: 78360 - 315245  (t) 
#>   fbar: 0.20 - 0.72  (f)