#----------------------
a <- rnorm(100)
# it's simply more human readable if I can write
which( isIn( c(-0.5, 0.5), a) )
# instead of
which( a > -0.5 & a < 0.5 )
Thanks to baptiste! So there is no method available doing this and I have to
define this by myself. That's all I wanted to know :-)
Antje
markleeds at verizon.net schrieb:
hi: could you explain EXACTLY what you want to do with the dataframe
because it shouldn't be that different ?
On Tue, Dec 16, 2008 at 5:09 AM, Antje 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 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?
Antje