search for: brkarrintolistalong

Displaying 1 result from an estimated 1 matches for "brkarrintolistalong".

2011 Jan 17
1
how to cut a multidimensional array along a chosen dimension and store each piece into a list
...a multiple dimensional array along a chosen dimension and then store each piece (still an array of one dimension less) into a list. For example, arr <- array(seq(1*2*3*4),dim=c(1,2,3,4)) # I made a point to set the length of the first dimension be 1to test whether I worry about drop=F option. brkArrIntoListAlong <- function(arr,alongWhichDim){ #### return(outlist) } I have tried splitter_a in plyr package but does not get what I want. library(plyr) plyr:::splitter_a(arr,3) I understand that I can write a for loop to make it happen but I am searching for a better solution. Thanks in advance. -Sean...