> On 30-03-2015, at 09:59, Stéphane Adamowicz > <stephane.adamow...@avignon.inra.fr> wrote: > > > Le 27 mars 2015 à 18:01, David Winsemius <dwinsem...@comcast.net> a écrit : > >> >> On Mar 27, 2015, at 3:41 AM, Stéphane Adamowicz wrote: >> >>> Well, it seems to work with me. >>> >> >> No one is doubting that it worked for you in this instance. What Peter D. >> was criticizing was the construction : >> >> complete.cases(t(Y))==T >> >> ... and it was on two bases that it is "wrong". The first is that `T` is not >> guaranteed to be TRUE. The second is that the test ==T (or similarly ==TRUE) >> is completely unnecessary because `complete.cases` returns a logical vector >> and so that expression is a waste of time. >> > > Indeed, You are right, the following code was enough : > « Z <- Y[, complete.cases(t(Y) ] » > > > However, in order to help me understand, would you be so kind as to give me a > matrix or data.frame example where « complete.cases(X)== T » or « > complete.cases(X)== TRUE » would give some unwanted result ?
T can be redefined. Try this in your example with airquality: T <- "hello" Z <- Y[,complete.cases(t(Y))==T] Z TRUE is a reserved word and cannot be changed. But why use ==TRUE if not necessary? All of this mentioned already by David Winsemius in a previous reply. Berend ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.