The MARGIN parameter of the apply function. If set to NULL then the fun will be applied to the entire stack, producing a single layer.
na.rm
Remove NA values, if supported by 'fun' (only relevant when summarizing a multilayer Raster object into a RasterLayer)
forcefun
logical. Force calc to not use fun with apply; for use with ambiguous functions and for debugging (see Details)
forceapply
logical. Force calc to use fun with apply; for use with ambiguous functions and for debugging (see Details)
Details
The method is an extension of the calc function. The strucuture expressed as the RasterArray's dimensions allows the calculations to be iterated for different margins of the array, similarly to the apply function, controlled by the margin argument.