I would like to sort matrix3, so that every column in output matrix is sorted. Also I have to "unsort" it later on.
matrix1<-matrix(rnorm(100,354,78),ncol=10) matrix2<-matrix(rnorm(100,225,102),ncol=10) matrix3<-cbind(matrix1,matrix2) nrCol<-length(matrix3[1,]) class1<-1:10 for(i in 1:nrCol) { sorted.matrix<-matrix3[order(matrix3[class1,i]),] } for(i in 1:liczbaKolumn) { output<-sorted.matrix[order(matrix3[class1,i]),] } -- Aleksandra Cabaj [[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.