# figure out whether 1 is between two numbers

6 messages
Open this post in threaded view
|

## figure out whether 1 is between two numbers

 Hi R users I have two variables (X and Y) X <-  rnorm(100,.7,.5) Y <-  rnorm (100,.3,.1) I like to know whether 1 is between each pair of X and Y or not. Thanks TM ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Open this post in threaded view
|

## Re: figure out whether 1 is between two numbers

 (X < 1) & (Y > 1) On 2/18/06, Taka Matzmoto <[hidden email]> wrote: > > Hi R users > > I have two variables (X and Y) > > X <-  rnorm(100,.7,.5) > Y <-  rnorm (100,.3,.1) > > I like to know whether 1 is between each pair of X and Y or not. > > Thanks > > TM > > ______________________________________________ > [hidden email] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help> PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html> -- Jim Holtman Cincinnati, OH +1 513 646 9390 What the problem you are trying to solve?         [[alternative HTML version deleted]] ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Open this post in threaded view
|

## Re: figure out whether 1 is between two numbers

 In reply to this post by Taka Matzmoto Try: (X>1 & Y<1) | (X<1 & Y>1) Rob ----- Original Message ----- From: "Taka Matzmoto" <[hidden email]> To: <[hidden email]> Sent: Friday, February 17, 2006 11:20 PM Subject: [R] figure out whether 1 is between two numbers > Hi R users > > I have two variables (X and Y) > > X <-  rnorm(100,.7,.5) > Y <-  rnorm (100,.3,.1) > > I like to know whether 1 is between each pair of X and Y or not. > > Thanks > > TM > > ______________________________________________ > [hidden email] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help> PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html> ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Open this post in threaded view
|

## Re: figure out whether 1 is between two numbers

 On 2/18/2006 1:13 AM, Robert W. Baer, Ph.D. wrote: > Try: > (X>1 & Y<1) | (X<1 & Y>1) This is a minor stylistic suggestion: when translating the mathematical expression (a < b < c), write it as (a < b) & (b < c).  It has no effect on the outcome, but keeping the inequalities in the same direction makes the meaning more obvious. If you do this, your expression becomes (Y<1 & 1 > Rob > ----- Original Message ----- > From: "Taka Matzmoto" <[hidden email]> > To: <[hidden email]> > Sent: Friday, February 17, 2006 11:20 PM > Subject: [R] figure out whether 1 is between two numbers > > >> Hi R users >> >> I have two variables (X and Y) >> >> X <-  rnorm(100,.7,.5) >> Y <-  rnorm (100,.3,.1) >> >> I like to know whether 1 is between each pair of X and Y or not. >> >> Thanks >> >> TM >> >> ______________________________________________ >> [hidden email] mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help>> PLEASE do read the posting guide! >> http://www.R-project.org/posting-guide.html>> > > ______________________________________________ > [hidden email] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide! http://www.R-project.org/posting-guide.html