[R] figure out whether 1 is between two numbers

Robert W. Baer, Ph.D. rbaer at atsu.edu
Sat Feb 18 07:13:39 CET 2006


Try:
(X>1 & Y<1) | (X<1 & Y>1)

Rob
----- Original Message ----- 
From: "Taka Matzmoto" <sell_mirage_ne at hotmail.com>
To: <r-help at stat.math.ethz.ch>
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
>
> ______________________________________________
> R-help at 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
>




More information about the R-help mailing list