Re: [R] Ask for help: find corresponding elements between matrix

2013-02-21 Thread Berend Hasselman
On 21-02-2013, at 15:39, JiangZhengyu wrote: > Dear R experts, > > I have two matrix (seq & mat) & I want to retrieve in a new matrix all the > numbers from mat that =1 (corresponding to the same row/ column position) in > seq, or all the numbers in mat that =-1 in seq. - Replace all the numb

Re: [R] Ask for help: find corresponding elements between matrix

2013-02-21 Thread Jose Iparraguirre
hengyu Sent: 21 February 2013 14:39 To: r-help@r-project.org Subject: [R] Ask for help: find corresponding elements between matrix Dear R experts, I have two matrix (seq & mat) & I want to retrieve in a new matrix all the numbers from mat that =1 (corresponding to the same row/

Re: [R] Ask for help: find corresponding elements between matrix

2013-02-21 Thread arun
[,4] #[1,] 0.2588229  0.8971982 NA -1.0750013 #[2,] 1.8311207  0.4880163 NA  0.8550108 #[3,]    NA -1.2553858 -0.1321224 NA A.K. - Original Message - From: JiangZhengyu To: r-help@r-project.org Cc: Sent: Thursday, February 21, 2013 9:39 AM Subject: [R] Ask for h

[R] Ask for help: find corresponding elements between matrix

2013-02-21 Thread JiangZhengyu
Dear R experts, I have two matrix (seq & mat) & I want to retrieve in a new matrix all the numbers from mat that =1 (corresponding to the same row/ column position) in seq, or all the numbers in mat that =-1 in seq. - Replace all the numbers with NA if it's not 1/-1 in seq. There ar