apply-methods: apply method for FLCore classes

apply,FLArray,numeric,function-methodR Documentation

apply method for FLCore classes

Description

Applies a function over the margins of an array-based FLCore class

Usage

## S4 method for signature 'FLArray,numeric,function'
apply(X, MARGIN, FUN, ..., simplify = TRUE)

## S4 method for signature 'FLPar,ANY,ANY'
apply(X, MARGIN, FUN, ..., simplify = TRUE)

## S4 method for signature 'FLQuantJK,numeric,function'
apply(X, MARGIN, FUN, ..., simplify = TRUE)

## S4 method for signature 'FLParJK,numeric,function'
apply(X, MARGIN, FUN, ..., simplify = TRUE)

Details

These methods call R's base::apply on an FLArray the standard arithmetic operators included in the Arith group ("+", "-", "*", '"^", "%%", "%/%", and "/"), so that they return an object of the appropriate class.

When the operation involves objects of two classes (e.g. FLPar and FLQuant), the class is the returned object is that of the more complexs object, in this case FLQuant.

Author(s)

The FLR Team

See Also

base::apply

Examples


flq <- FLQuant(rlnorm(90), dim=c(3,10), units='kg')
flp <- FLPar(a=99)

# FLQuant and numeric
flq * 25
# Two FLQuant objects
flq + flq


flr/FLCore documentation built on May 4, 2024, midnight