slim: Drop unnecesary 'iters'

slimR Documentation

Drop unnecesary 'iters'

Description

Objects of FLR classes can vary in the length along the sixth dimension in any slot of class FLQuant. This reduces object size and memory usage. If an object has been extended fully, for example by using propagate, we can slim down the object by reducing any slot where all iters are identical and keeping only yhe first iter.

Usage

slim(object, ...)

## S4 method for signature 'FLComp'
slim(object, ...)

Arguments

object

A complex FLR object to slim down.

Details

The test for whether an slot can be slimmed is based on checking if the sum of the variance along the 6th dimensions is equal to zero.

Value

An object of the same class as the input.

Author(s)

The FLR Team

See Also

FLQuant propagate

Examples

data(ple4)
# Extend all of ple4 to 50 iters
ple4 <- propagate(ple4, 50)
# Add variability in catch.n
catch.n(ple4) <- rlnoise(50, log(catch.n(ple4)), log(catch.n(ple4))/10)
summary(ple4)
# slim object by dropping identical iters
sple4 <- slim(ple4)
summary(sple4)

flr/FLCore documentation built on May 4, 2024, midnight