[R] Find all numbers in a certain interval
vitosmail at rambler.ru
Wed Dec 17 11:53:39 CET 2008
If you can formulate your question it in terms of actual problem you have with data.frame it would be easier to answer.
for the time being check subset() if it is what you want.
On Tue, 16 Dec 2008 11:09:19 +0100, Antje <niederlein-rstat at yahoo.de> wrote:
> 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
> 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