50% off | Unlimited Data & AI Learning

Last chance! 50% off unlimited learning

Sale ends in


narray (version 0.5.1)

map: Maps a function along an array preserving its structure

Description

Maps a function along an array preserving its structure

Usage

map(X, along, FUN, subsets = base::rep(1, dim(X)[along]), drop = TRUE,
  ...)

Value

An array where FUN has been applied

Arguments

X

An n-dimensional array

along

Along which axis to apply the function

FUN

A function that maps a vector to the same length or a scalar

subsets

Whether to apply FUN along the whole axis or subsets thereof

drop

Remove unused dimensions after mapping; default: TRUE

...

Other arguments passed to FUN