Hello, I'm at the very beginning of the learning process of this language. Sorry in advance for the (possible but plausible) stupidity of my question.
I would like to find a way to permute the DIMENSIONS of an array. Something that sounds like the function "permute()" in matlab. Given an array C of dimensions c x d x T , for instance, the command permute(C, [2 1 3]) would provide (in Matlab) an array very similar to C, but this time each one of the T matrices c x d has changed into its transposed. Any alternatives to the following (and primitive) 'for' cycle? *# (previously defined) phi=array with dimensions c(c,d,T)* * * *temp=array(0,dim=c(c,d,T))* * for(i in 1:T)* * {* * temp[,,i]=t(phi[,,i])* * }* * phi=temp* * * Thank you very much! S -- ------------------------------------------------------------------- Simone Salvadei Faculty of Economics Department of Financial and Economic Studies and Quantitative Methods University of Rome Tor Vergata e-mail: simone.salva...@uniroma2.it <federico.belo...@uniroma2.it> url: http://www.economia.uniroma2.it/phd/econometricsempiricaleconomics/ <http://www.econometrics.it/> ------------------------------------------------------------------- [[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.