split_along_dim: create a list with members being the matrices along a...

View source: R/utils.R

split_along_dimR Documentation

create a list with members being the matrices along a specified dimension of an array

Description

This is from a StackOverflow answer

Usage

split_along_dim(a, n)

Arguments

a

an array

n

along which dimension to create a list

Value

a list

See Also

Other utility functions: make_list()

Examples


myarray <- array(c(1,2,3,4,5,6,7,8),c(2,2,2))

split_along_dim(myarray,1)
split_along_dim(myarray,2)
split_along_dim(myarray,3)

zhenkewu/lotR documentation built on April 24, 2022, 2:36 a.m.