Skip to content
Back to formatted view

Raw Message

Message-ID: <201101241927.30889.Rainer.Schuermann@gmx.net>
Date: 2011-01-24T18:27:30Z
From: Rainer Schuermann
Subject: Find the sign
In-Reply-To: <924459.23638.qm@web120109.mail.ne1.yahoo.com>

On Monday, January 24, 2011 07:18:03 pm Alaios wrote:
> Hello :)
> I wanted to right an expression to check when x and y have the same sign
> and I wrote the following:
> 
>  if ((x<0 && y<0) || (x>0 && y>0)) 
> 
> which looks pretty ugly to me.
> 
> Can you please suggest me a better way for that?
> 
> Regards
> Alex
> 
> ______________________________________________
> R-help at r-project.org 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.
> 


if( sign( x ) == sign( y ) )