stable.apply {mathgraph}R Documentation

Apply with Stable Dimensions

Description

Does the same thing as apply except that when the function returns a vector, the dimensions are put back the way they started.

Usage

stable.apply(X, MARGIN, FUN, ...)

Arguments

X same as in apply.
MARGIN same as in apply.
FUN same as in apply.
... same as in apply.

Value

When FUN returns a scalar or when MARGIN has a length that is not one less than the number of dimensions in X, then the same as apply.
Otherwise, an array similar to the result of apply, but with the dimensions permuted to correspond to the dimensions of X.

Author(s)

Nick Efthymiou

References

S Poetry, Patrick J. Burns, http://www.burns-stat.com/pages/spoetry.html

See Also

apply, aperm

Examples

data(freeny)
stable.apply(freeny.x, 1, sort)
# compare to:
apply(freeny.x, 1, sort)


[Package mathgraph version 0.9-8 Index]