Re: [R] Errors in if statement

2012-09-29 Thread arun
, 2012 10:55 PM Subject: RE: [R] Errors in if statement Thanks, Arun. The matrix format & put "NA" with 0 help.  but how do I do all the rows. Is the loop still OK? Z > Date: Fri, 28 Sep 2012 18:13:39 -0700 > From: smartpink...@yahoo.com > Subject: Re: [R] Errors in if st

Re: [R] Errors in if statement

2012-09-29 Thread arun
se((sum(x!=2)>3) & (sum(x==1)>=1) & (sum(x==3)>=1), 1,0) ) tmp #[1] 0 0 0 0 1 A.K. - Original Message - From: JiangZhengyu To: Cc: r-help@r-project.org Sent: Friday, September 28, 2012 4:16 PM Subject: [R] Errors in if statement Hi guys, I have many rows (>1000) and

Re: [R] Errors in if statement

2012-09-28 Thread David Winsemius
On Sep 28, 2012, at 1:16 PM, JiangZhengyu wrote: > > Hi guys, I have many rows (>1000) and columns (>30) of "geno" matrix. I use > the following loop and condition statement (adapted from someone else code). > I always have an error below. I was wondering if anyone knows what's the > problem

[R] Errors in if statement

2012-09-28 Thread JiangZhengyu
Hi guys, I have many rows (>1000) and columns (>30) of "geno" matrix. I use the following loop and condition statement (adapted from someone else code). I always have an error below. I was wondering if anyone knows what's the problem & how to fix it. Thanks,Zhengyu ### geno matrix P