[R] Between the values

Ling, Gary (Electronic Trading) Gary_Ling at ml.com
Tue Aug 12 23:27:36 CEST 2008


# between (a,b)
a <- 0
b <- 1
x <- rnorm(10)
x
unclass(cut(x, breaks=c(-Inf,a,b,Inf)))==2

-gary

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On Behalf Of Shubha Vishwanath Karanth
Sent: Tuesday, August 12, 2008 7:46 AM
To: r-help at stat.math.ethz.ch
Subject: [R] Between the values


Hi R,

 

This is a very trivial one....

 

C=0.1

 

I want to check whether my value of C is between 0 and 1 exclusively....
I don't want to use (C>0 & C<1). And I can't use a single statement like
(0<C<1). Is there a between function? Or how do we specify from 0 to 1?
Does %in% help me?

 

 

Many Thanks,

Shubha

 

This e-mail may contain confidential and/or privileged
i...{{dropped:13}}

______________________________________________
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.
--------------------------------------------------------

This message w/attachments (message) may be privileged, confidential or proprietary, and if you are not an intended recipient, please notify the sender, do not use or share it and delete it. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Merrill Lynch. Subject to applicable law, Merrill Lynch may monitor, review and retain e-communications (EC) traveling through its networks/systems. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or error-free. This message is subject to terms available at the following link: http://www.ml.com/e-communications_terms/. By messaging with Merrill Lynch you consent to the foregoing.



More information about the R-help mailing list