I am looking for a fast way to remove redundant dimensions from an array in R, similar to the squeeze() command in MATLAB. Right now I combine the melt()<
squeeze()
melt()<
It sounds like you're looking for drop(), which "delete[s] the dimensions of an array which have only one level".
drop()
drop(array3d) # [,1] [,2] # [1,] 0 0 # [2,] 0 0