Apply a function to a margin of an array

WWW: https://cran.r-project.org/package=arrApply
