FLQuantSums: Methods to compute sums, means and vars of FLQuant objects

Description Generic function Method arguments Methods Author(s) See Also Examples

Description

This set of methods computes three different summaries (sum, mean and variance) of an FLQuant object along each of the six dimensions (quant, year, unit, season, area, or iter). Three methods (dimSums, dimMeans and dimVars) operate by default over the second to fifth dimensions (unit, season and area).

These methods simply encapsulate a call to apply with the corresponding dimension and function.

Sums are not calculated for the iter dimension, as it is used to store multiple replicates of a given array of values.

Methods to operate over the first dimension refer to it as the quant dimension, regardless of the actual name used in the object.

The output object will have length=1 on the selected dimension.

Generic function

quantSums(x), quantMeans(x), quantVars(x)

yearSums(x), yearMeans(x), yearVars(x)

unitSums(x), unitMeans(x), unitVars(x)

seasonSums(x), seasonMeans(x), seasonVars(x)

areaSums(x), areaMeans(x), areaVars(x)

iterMeans(x), iterVars(x)

dimSums(x), dimMeans(x), dimVars(x)

Method arguments

x :

an object of a class for which this method has been defined.

na.rm :

a logical indicating whether NAs should be deleted from the calculations. Defaults to TRUE.

dim :

numeric, the dimensions over which dimSums, dimMeans or dimVars should operate. Defaults to c(1:2,6).

Methods

signature(x=FLQuant) :

Computes a given summary statistic over a certain dimension of an FLQuant.

Author(s)

The FLR Team

See Also

FLQuant, sum, mean, var

Examples

1
2
3
4
5
6
 flq <- FLQuant(rnorm(4000), dim=c(5,10,2,2,2,10), quant='age')
 quantSums(flq)
 quantMeans(flq)
 yearSums(flq)
 iterMeans(flq)
 dim(quantSums(flq))

FLCore documentation built on May 2, 2019, 5:46 p.m.