Hello,
Be sure to include the mailing list,<r-help at r-project.org> when you
reply. In this way to improve your chances of obtaining a good answer
and everyone benefits.
May be something like this ?
aa <- matrix(1:9,3,3)
matrix(as.numeric(aa)[!as.numeric(aa) %in% diag(aa)],2,3)
[,1] [,2] [,3]
[1,] 2 4 7
[2,] 3 6 8
Hope it helps,
Jeremie
malika yassa <yassa_malika at yahoo.fr> writes:
hellow
yes i want to extract the non-diagonal part
for exampl
i have this matrix [,1] [,2] [,3]
[1,] 1 4 7
[2,] 2 5 8
[3,] 3 6 9the result
[,1] [,2] [,3]
[1,] 2 4 7
[2,] 3 6 8
Le samedi 20 octobre 2018 ? 15:21:53 UTC+2, Jeremie Juste <
jeremiejuste at gmail.com> a ?crit :
malika yassa via R-help <r-help at r-project.org> writes:
Hello,
Can you specify what you mean by deleting exactly?
Do you want to have zero in the diagonal or do you want to extract the
non-diagonal part?
Besides your matrix is not a square matrix. Do you really want to
extract the non-diagonal part of a non square matrix?
Best regards,
Jeremie
hellowplease,do you help mei have this matrixm<-matrix(( 1:12, nrow = 3
I want to delete the diagonal values of this matrix
can anyone do thisthinks
[[alternative HTML version deleted]]