Re: [R] extrat non diagonal value

2018-11-14 Thread Michael Dewey
When that arrived it was a complete mess since you posted in HTML which 
scrambles your code and you sent code which had syntax errors. Please 
try again by posting in plain text and cut and paste your code. It would 
also help if you stated exactly what you expected your output to consist of.


Michael

On 14/11/2018 11:19, malika yassa via R-help wrote:

helloplease i have this matrixx<-rnorm(6,0,1)

aa<-matrix(x,nrow=6,ncol=6)

i have to extrat non diagonal value, i use this code
matrix(as.numeric(aa)[!as.numeric(aa) %in% diag(aa)],5,6)

but i didn't get the resultthank 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.



--
Michael
http://www.dewey.myzen.co.uk/home.html

__
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.


Re: [R] extrat non diagonal value

2018-11-14 Thread PIKAL Petr
Hi.

You did not specify what do you want to do with the result.

functions

upper.tri, lower.tri and diag can manipulate parts of matrices.

Cheers
Petr

> -Original Message-
> From: R-help  On Behalf Of malika yassa via R-
> help
> Sent: Wednesday, November 14, 2018 12:20 PM
> To: R-help Mailing List 
> Subject: [R] extrat non diagonal value
>
> helloplease i have this matrixx<-rnorm(6,0,1)
>
> aa<-matrix(x,nrow=6,ncol=6)
>
> i have to extrat non diagonal value, i use this code
> matrix(as.numeric(aa)[!as.numeric(aa) %in% diag(aa)],5,6)
>
> but i didn't get the resultthank 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.
Osobní údaje: Informace o zpracování a ochraně osobních údajů obchodních 
partnerů PRECHEZA a.s. jsou zveřejněny na: 
https://www.precheza.cz/zasady-ochrany-osobnich-udaju/ | Information about 
processing and protection of business partner’s personal data are available on 
website: https://www.precheza.cz/en/personal-data-protection-principles/
Důvěrnost: Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a 
podléhají tomuto právně závaznému prohláąení o vyloučení odpovědnosti: 
https://www.precheza.cz/01-dovetek/ | This email and any documents attached to 
it may be confidential and are subject to the legally binding disclaimer: 
https://www.precheza.cz/en/01-disclaimer/

__
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.