Dear R-Helpers, I wonder whether there is a function which cuts 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 [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.