apply: Method apply

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

Description

Functions can be applied to margins of an FLQuant array using this method. In contrast with the standard method, dimensions are not collapsed in the output object.

FUN in the case of an FLQuant must collapse at least one dimension when applied over an array.

For further details see apply.

Generic function

apply(X,MARGIN,FUN)

Method arguments

X :

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

MARGIN :

a vector giving the subscripts which the function will be applied over. 1 indicates rows, 2 indicates columns, c(1,2) indicates rows and columns, etc.

FUN :

the function to be applied.

... :

optional arguments to FUN.

Methods

signature(X=ANY,MARGIN=missing,FUN=missing) :

New S4 generic based on base::apply

signature(X=FLQuant,MARGIN=numeric,FUN=function) :

apply a given function over the selected dimensions of an FLQuant. Returns an object of class FLQuant.

Author(s)

The FLR Team

See Also

apply

Examples

1
2
3
flq <- FLQuant(rlnorm(100), dim=c(10,20,1,1,1,5))
apply(flq, 1, sum)
apply(flq, 2:6, sum)

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