given a list of arrays (could be matrices), all of the same dimension, and a function, returns an array of the same dimensions as the objects of the list, for which each element is the application of the function to the vector of cells in a position across all arrays in the list.

elementWise(arrayList, fnc = mean)

Arguments

arrayList

The list of arrays to which the function will be applied

fnc

The function that can be applied to a vector

Value

Array of the function values

Examples

cellMeans <- elementWise(lapply(replicRecords, mean_records))
#> Error in lapply(replicRecords, mean_records): object 'replicRecords' not found