sweep {FLCore}R Documentation

Sweep out FLQuant Summaries

Description

Return an FLQuant obtained from an input FLQuant by sweeping out a summary statistic along the selected dimensions.

Value

An FLQuant with the same shape as x, but with the summary statistics swept out.

Generic function

sweep(x, MARGIN, STATS, FUN="-", check.margin=TRUE, ...)

Method arguments

x
an FLQuant.
MARGIN
a vector of indices giving the extents of x which correspond to STATS.
STATS
the summary statistic which is to be swept out.
FUN
the function to be used to carry out the sweep. In the case of binary operators such as "/" etc., the function name must backquoted or quoted. (FUN is found by a call to match.fun.)
check.margin
logical. If TRUE (the default), warn if the length or dimensions of STATS do not match the specified dimensions of x. Set to FALSE for a small speed gain when you know that dimensions match.
...
optional arguments to FUN.

Author(s)

The FLR Team

See Also

sweep

Examples

   data(ple4)
   mean.f <- apply(harvest(ple4),2,mean)
   scaled.f <- sweep(harvest(ple4),2,mean.f,"/")

[Package FLCore version 2.2 Index]