Re: [R] which() function help page precision

2018-11-17 Thread Juan Gomez
Hi again (, I am the PO from my own email account) I agree that the word "basically" puts the NA issues aside. But my point is that R subsetting behavior when there are NAs in a logical index is quite tricky to say the less, and deserves the trouble of pointing it out in every place it is appro

Re: [R] which() function help page precision

2018-11-16 Thread Martin Maechler
> peter dalgaard > on Fri, 16 Nov 2018 13:39:27 +0100 writes: > Well, "Basically, " is an excuse for not being > accurate. Making the code more complex doesn't really help > the explanation. It could be better to just add "(except > for NA handling)" or so. > -pd

Re: [R] which() function help page precision

2018-11-16 Thread peter dalgaard
Well, "Basically, " is an excuse for not being accurate. Making the code more complex doesn't really help the explanation. It could be better to just add "(except for NA handling)" or so. -pd > On 16 Nov 2018, at 11:08 , buzon informatica, ige > wrote: > > The which() function help page s

[R] which() function help page precision

2018-11-16 Thread buzon informatica, ige
The which() function help page states that, in the default case, what the function returns is: " Basically, the result is (1:length(x))[x]." That would only be true if there are not any NA values in x. I think it would be more accurate to say: "Basically, the result is (1:length(x))[!is.na(x) &