[R] (no subject)

John Fox jfox at mcmaster.ca
Sat Nov 5 15:57:56 CET 2005


Dear Erez,

How about C <- A + B ?

Regards,
 John

--------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4
905-525-9140x23604
http://socserv.mcmaster.ca/jfox 
-------------------------------- 

> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch 
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Erez
> Sent: Tuesday, November 01, 2005 5:39 AM
> To: r-help at stat.math.ethz.ch
> Subject: [R] (no subject)
> 
> Hi
> 
> I need an advise if any one can help me.
> i have mass of data in 2 array A and B:
> A = 0 1 0 0 1 1 0 0
> B = 0 0 0 1 0 1 1 1
> and i have 3 rules to merge them into 3rd array C:
> if A[i] + B[i] == 0 then C[i]=0
> if A[i] + B[i] == 1 then C[i]=1
> if A[i] + B[i] == 2 then C[i]=2
> it looks easy but with the regular way (loop) with large data 
> it takes days (i test it).
> If any one can advise me what to do i'll be happy.
> 
> Thanks
> Erez  
>  
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html




More information about the R-help mailing list