hello for examplei have this matrix w2<-c(0.1,0.2,0.4,0.2,0.4,0.1)aa<-matrix(w1,nrow=3,ncol=3)aa [,1] [,2] [,3] [1,] 0.4 0.4 0.4 [2,] 0.1 0.1 0.1 [3,] 0.2 0.2 0.2
if i use this code matrix(as.numeric(aa)[!as.numeric(aa) %in% diag(aa)],2,3) i will obtaine this matrix[,1] [,2] [,3] [1,] NA NA NA [2,] NA NA NA but me i want this matrix[,1] [,2] [,3] [1,] 0.1 0.4 0.4 [2,] 0.2 0.2 0.1 thank you [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.