[R] Find all numbers in a certain interval
niederlein-rstat at yahoo.de
Wed Dec 17 14:02:00 CET 2008
Thanks a lot for every answer I got!
I could solve my problem!
Greg, your proposal seems to be quite useful for me :-) Thank you.
> Hi all,
> I'd like to know, if I can solve this with a shorter command:
> a <- rnorm(100)
> which(a > -0.5 & a < 0.5)
> # would give me all indices of numbers greater than -0.5 and smaller
> than +0.5
> I have something similar with a dataframe and it produces sometimes
> quite long commands...
> I'd like to have something like:
> which(within.interval(a, -0.5, 0.5))
> Is there anything I could use for this purpose?
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help