RE: [R] if..else.. need help

From: Huntsinger, Reid <>
Date: Sat 26 Mar 2005 - 05:35:12 EST

Well, if you type that at a command prompt, the expression is complete after the end of the "if" so you have an "else {}" which is orphaned. I think people usually use this style

if() {

} else {


or something similar to prevent this.

Reid Huntsinger

-----Original Message-----
[] On Behalf Of Sent: Friday, March 25, 2005 1:24 PM
To: Jeff D. Hamann
Subject: [R] if..else.. need help

Dear all,
 I don't know why the following doesn't work. if(cls$size[1]>cls$size[2])
 {cls1<-tempforce[cls$cluster==1];cls2<-tempforce[cls$cluster==2]} else {cls1<-tempforce[cls$cluster==2];cls2<-tempforce[cls$cluster==1]}

Error: syntax error

What is the problem here?

Ming mailing list PLEASE do read the posting guide! mailing list PLEASE do read the posting guide! Received on Sat Mar 26 05:39:20 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:56 EST