apply,FLArray,numeric,function-method | R Documentation |
Applies a function over the margins of an array-based FLCore class
## 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)
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
.
The FLR Team
base::apply
flq <- FLQuant(rlnorm(90), dim=c(3,10), units='kg')
flp <- FLPar(a=99)
# FLQuant and numeric
flq * 25
# Two FLQuant objects
flq + flq
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.