> From: Vadim Ogranovich
>
> Hi,
>
> It turns out that the 'test' vector in ifelse(test, yes, no) is not
> recycled if it is shorter than the other arguments, e.g.
>
> > ifelse(TRUE, seq(10), -seq(10))
> [1] 1
>
>
> Is there any particular reason it is not recycled? If there is one
> indeed a warning message might be in order when someone calls ifelse
> with a shorter 'test'.
?ifelse says:
Value:
A vector of the same length and attributes (including class) as
'test' and data values from the values of 'yes' or 'no'. ...
Seems to me it works as documented. Why do you expected otherwise?
Andy
> This is R1.8.1 on RH-7.3
>
> Thanks,
> Vadim
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
>
______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html