Re: [R] if statement error

From: Jenny Stadt <jennystadt_at_yahoo.ca>
Date: Tue 17 Oct 2006 - 18:08:18 GMT

Thank you all for the advice here. I followed the suggestion that check the output of the parameters, and found that there might be two possibilities to cause the problem. First was there was missing value in real.d / real.b; the second was when beta2 was NA. I fixed the data set and the error no longer shows up.

Thank you very much!

Jen

-----Original Message-----
From:Alberto Monteiro , albmont@centroin.com.br Sent: 2006-10-17, 11:36:40
To: r-help@stat.math.ethz.ch
CC:
Subject: Re: [R] if statement error
Jenny Stadt wrote:
>
> I was not able to make this work. I know it is a simple one, sorry
> to bother. Give me some hints pls. Thanks!
>
Are you a C programmer? :-)

> if(length(real.d) >=30 && length(real.b) >=30 &&
> beta1*beta2*theta1*theta2 >0 )
>
> { r <- 1; corr <- 1; }
>
I _think_ you should use & instead of &&. And drop the second ";".

Also, don't forget that "return x" is wrong [it took me a long time to figure out that R != C, and it's just return(x)]

Alberto Monteiro



R-help@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 and provide commented, minimal, self-contained, reproducible code.

        [[alternative HTML version deleted]]



R-help@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 and provide commented, minimal, self-contained, reproducible code. Received on Wed Oct 18 05:14:50 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 17 Oct 2006 - 20:30:32 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.