Re: [R] if syntax error :(

From: Sarah Goslee <>
Date: Wed 14 Jun 2006 - 04:39:46 EST

You need more brackets:

if(blah) {
  do something
} else {
  do something different


PS Using underscores in variable names is not encouraged, and can cause you problems in certain contexts.

On 6/13/06, H. Paul Benton <> wrote:
> Umm sorry to bother everyone again but I'm having trouble with my if
> statement. I come from a perl background so that's probably my problem! :)
> So here is my code:
> if (any(lgAB>4) | any(lgAB<-4)){
> freq_AB<-hist(lgAB, type="o", plot=F)
> else
> freq_AB<-hist(lgAB, breaks=br,type ="o", plot=F)
> }

Sarah Goslee

	[[alternative HTML version deleted]]

______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Wed Jun 14 05:53:45 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 Wed 14 Jun 2006 - 06:12:18 EST.

Mailing list information is available at Please read the posting guide before posting to the list.