[R] (no subject)
Jeremie Juste
jerem|eju@te @end|ng |rom gm@||@com
Sat Oct 20 17:48:39 CEST 2018
Hello,
Be sure to include the mailing list,<r-help using 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 using 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 using gmail.com> a écrit :
>
> malika yassa via R-help <r-help using 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]]
>>
>> ______________________________________________
>> R-help using 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.
More information about the R-help
mailing list