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.
Ciao,
Antje
Antje schrieb:
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
Hi,
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.
SV.
On Tue, 16 Dec 2008 11:09:19 +0100, Antje wrote:
Hi all,
I'd like to know, if I can solve this with a sho
Here are a couple of function definitions that may be more intuitive for some
people (see the examples below the function defs). They are not perfect, but
my tests showed they work left to right, right to left, outside in, but not
inside out.
`%<%` <- function(x,y) {
xx <- attr(x,'orig
On Dec 16, 2008, at 7:19 AM, Antje wrote:
Hi David,
thanks a lot for your proposal. I got a lot of useful hints from all
of you :-)
David Winsemius schrieb:
It's not entirely clear what you are asking for, since
which(within.interval(a, -0.5, 0.5)) is actually longer than
which(a > -0.
Antje wrote:
Hi,
sorry, but it shouldn't be "different". The result should be the same but I was
looking if there is a method I can use...
# having a function defined like baptiste proposed:
isIn <-
function (interval, x)
{
(x > min(interval)) & (x < max(interval))
}
Along the lines
Hi David,
thanks a lot for your proposal. I got a lot of useful hints from all of you :-)
David Winsemius schrieb:
It's not entirely clear what you are asking for, since
which(within.interval(a, -0.5, 0.5)) is actually longer than which(a >
-0.5 & a < 0.5).
Right but in case 'a' is someth
Hi,
sorry, but it shouldn't be "different". The result should be the same but I was
looking if there is a method I can use...
# having a function defined like baptiste proposed:
isIn <-
function (interval, x)
{
(x > min(interval)) & (x < max(interval))
}
#--
a <- rno
It's not entirely clear what you are asking for, since
which(within.interval(a, -0.5, 0.5)) is actually longer than which(a >
-0.5 & a < 0.5). You mention that you want a solution that applies to
dataframes. Using indexing you can get entire rows of dataframes that
satisfy multiple condit
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.
9 matches
Mail list logo