[R] Number in interval

Steve Lianoglou mailinglist.honeypot at gmail.com
Mon Jul 18 00:06:47 CEST 2011


Also check out the 'cut' and 'findIntervals' functions if you need to
check for many intervals at once.

On Sunday, July 17, 2011, jim holtman <jholtman at gmail.com> wrote:
> try this:
>
>>  z <- c(-1.4,0.5,4.7)
>> (z >= -3) & (z <= 3)
> [1]  TRUE  TRUE FALSE
>>
>
>
> On Sun, Jul 17, 2011 at 10:54 AM, Manuel K. <b8220126 at klzlk.com> wrote:
>> Hi all,
>>
>> I have an interval (e.g [-3,3]) and a numeric vector z (-1.4,0.5,4.7). How
>> can I test whether an element in z lies between between -3,3? I particularly
>> need a TRUE/FALSE response.
>>
>> Thanks
>> Manuel
>>
>> --
>> View this message in context: http://r.789695.n4.nabble.com/Number-in-interval-tp3673537p3673537.html
>> Sent from the R help mailing list archive at Nabble.com.
>>
>> ______________________________________________
>> 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.
>>
>
>
>
> --
> Jim Holtman
> Data Munger Guru
>
> What is the problem that you are trying to solve?
>
> ______________________________________________
> 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.
>

-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact



More information about the R-help mailing list