The warning
1: In (ind.c == TRUE) & (ind.sgn == TRUE) :
longer object length is not a multiple of shorter object length
means that ind.c and ind.sgn have different lengths, for whatever reason.
Although R continues the routine, the warning should, in general, not be
ignored.
Try:
1:3 + 1:2
Hello,
First of all, that's not an error message, it's a warning.
As for your condition, it's too complicated. You don't need to test a
logical value for equality to TRUE, it's redundant. And any(x, y) is
equivalent to any(x, y, x & y). Try
any(ind.c, ind.r, ind.sgn)
and you'll be fine.
Hope
Dear R users,
I have the "any" function of R
any(ind.c, ind.r, ind.sgn)
all are logical factors
it works fine when any of three is true
but when they are combined it doesnt work.
i tried
this
any(ind.c, ind.r, ind.sgn,((ind.c==TRUE) & (ind.r==TRUE)),
((ind.c==TRUE) & (ind.sgn==TRUE)),((ind.
Is as.integer() redundant for this vector of integers?
any(c(1, 3) == 3.0 )
--
View this message in context:
http://r.789695.n4.nabble.com/Problem-with-any-tp2553226p2580659.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-pr
Hi Christofer,
I have just repeated this and changed the code a little and it gives the
correct result
> any(as.integer(c(1, 3)) == 3)
[1] TRUE
> any(as.integer(c(1, 3)) == 2)
[1] FALSE
> any(as.integer(c(1, 3)) == 1)
[1] TRUE
HTH
Chris
On 24 Sep 2010, at 10:07, Christofer Bogaso wrote:
> a
Hello,
try this way : any(as.integer(c(1, 3))==3)
cheers,
Jonas
Christofer Bogaso a écrit :
> Hi I have following line of code:
>
>> any(as.integer(c(1, 3))) == 3
> [1] FALSE
>
> Shouldn't I expect it is true?
>
> Thanks,
>
> __
> R-help@r-project
Hi I have following line of code:
> any(as.integer(c(1, 3))) == 3
[1] FALSE
Shouldn't I expect it is true?
Thanks,
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.
7 matches
Mail list logo