sweep: Sweep out FLQuant Summaries

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

Description

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

Value

An FLQuant or FLCohort 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 or FLCohort object.

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

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

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