I am looking for a quick way to remove redundant measurements from an array in R, similar to a command squeeze()
in MATLAB. Now I combine the team melt()
and cast()
out of the package reshape2
, but should be less complicated way to do the same.
Here is how I do it so far:
require(reshape2)
array3d <- array(rep(0,4),dim=c(1,2,2))
acast(melt(array3d),Var2~Var3)
source
share