apply {FLCore} | R Documentation

## Method apply

### 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-class. Returns an object of class FLQuant-class.

### Author(s)

The FLR Team

### See Also

apply

### Examples

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

[Package FLCore version 2.2 Index]