map {narray}R Documentation

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,
  ...)

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

Value

An array where FUN has been applied


[Package narray version 0.5.1 Index]