| sweep {FLCore} | R Documentation |
Return an FLQuant obtained from an input FLQuant by sweeping out a summary
statistic along the selected dimensions.
An FLQuant with the same shape as x, but with the summary
statistics swept out.
sweep(x, MARGIN, STATS, FUN="-", check.margin=TRUE, ...)
x
which correspond to STATS."/" etc., the function name
must backquoted or quoted. (FUN is found by a call to
match.fun.)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.FUN.The FLR Team
data(ple4) mean.f <- apply(harvest(ple4),2,mean) scaled.f <- sweep(harvest(ple4),2,mean.f,"/")