Re: [Rd] ifelse() woes ... can we agree on a ifelse2() ?

2016-11-26 Thread Suharto Anggono Suharto Anggono via R-devel
Related to the length of 'ifelse' result, I want to say that "example of different return modes" in ?ifelse led me to perceive a wrong thing in the past. ## example of different return modes: yes <- 1:3 no <- pi^(0:3) typeof(ifelse(NA,yes, no)) # logical typeof(ifelse

Re: [Rd] ifelse() woes ... can we agree on a ifelse2() ?

2016-11-26 Thread Suharto Anggono Suharto Anggono via R-devel
For S Ellison, just clarifying, I am Suharto Anggono, not Martin Maechler. "Martin et al.," from my previous E-mail was the beginning of message from Gabriel Becker, that I quoted. The quoted "still a bit disappointed that nobody has taken a look" is from Martin Maechler. In all of the proposed

Re: [Rd] ifelse() woes ... can we agree on a ifelse2() ?

2016-11-26 Thread S Ellison
> Just stating, in 'ifelse', 'test' is not recycled. As I said in "R-intro: > length of 'ifelse' result" > (https://stat.ethz.ch/pipermail/r-devel/2016-September/073136.html), > ifelse(condition, a, b) > returns a vector of the length of 'condition', even if 'a' or 'b' is longer. That is indee

Re: [Rd] ifelse() woes ... can we agree on a ifelse2() ?

2016-11-26 Thread Suharto Anggono Suharto Anggono via R-devel
Just stating, in 'ifelse', 'test' is not recycled. As I said in "R-intro: length of 'ifelse' result" (https://stat.ethz.ch/pipermail/r-devel/2016-September/073136.html), ifelse(condition, a, b) returns a vector of the length of 'condition', even if 'a' or 'b' is longer. On current 'ifelse' cod