[R] Variable passed to function not used in function in select=... in subset

Berwin A Turlach berwin at maths.uwa.edu.au
Tue Nov 11 17:45:31 CET 2008

On Tue, 11 Nov 2008 11:27:30 +0100
Wacek Kusnierczyk <Waclaw.Marcin.Kusnierczyk at idi.ntnu.no> wrote:

> Berwin A Turlach wrote:

> > Why is it worth asking this if nobody else asks it?  Most notably a
> > certain software company in Redmond, Washington, which is famous for
> > carrying on with bad designs and bugs all in the name of backward
> > compatibility.  Apparently this company also sets industry
> > standards so it must be o.k. to do that. ;-)
> >   
> sure.  i have had this analogy in mind for a long time, but just
> didn't want to say it aloud.  

Mate, if you contemplate comparing R to anything coming out of Redmond,
Washington, then you should first heed the old saying that "it is
better to remain silent and let people believe that one is a fool than
to open one's mouth and remove any doubt". :)

> indeed, r carries on with bad design, but since there are more and
> more users, it's just fine.

Whether R carries on with bad design is debatable.  Clearly the changes
that you would like to see would lead to big changes that might break a
lot of existing code and programming idioms.  Such changes could
estrange large part of the user base and, in a worst case scenario,
make R unusable for many tasks it is used now.  No wonder that nobody
is eager to implement such design changes.  Apparently Python is
planning such whole sale changes when moving to version 3.x.  Let's see
what that does to the popularity of Python and the uptake of the new

> > Didn't see any confused complaints yet.  
> really.  the discussion was motivated precisely by a user's
> complaint. 

We must have different definition of what constitutes a complaint.  I
looked at the initial posting again.  In my book there was no
complaint.  Just a user who asked how to achieve a certain aim because
the way he tried to achieve it did not work.  There were three or four
constructive answers that pointed out how it can be done and then all
of a sudden complaints about alleged design flaws of R started.

> just scan this list;  a large part of the questions stems from
> confusion, which results directly from r's design. 

That's your opinion, to which you are of course entitled to.  In my
opinion, a large part of the questions on r-help these days stem from
the fact that in this age of instant gratification it seems to be
easier to fire off an e-mail to a mailing list and try to pick the
brain of thousands of subscribers  instead of spending time on trying
to read the documentation, learn about R and figure out the question on
one's own.

> >> because r is likely to do everything but what the user expects.
> >
> > This is quite a strong statement, and I wonder what the basis is for
> > that a statement.  Care to provide any evidence?
> i could think of organizing a (don't)useR conference, where
> submissions would provide such evidence.  

Please do so.  Such a conference would probably turn out to be more
hilarious and funnier than the Melbourne International Comedy Festival;
should be real fun to attend. :)

> whatever i say here, is mostly discarded as nonsense comments (while
> it certainly isn't), you say i make the problem up (while i just
> follow up user's complaints).  seriously, i may have exaggerated in
> the immediately above, but lots of comments made here by the users
> convince me that r very often breaks expectations.

Ever heard about biased sampling?  On a list like this you, of course,
hear questions by useRs who had the wrong expectations about how R
should behave and got surprised.  You do not hear of all the instances
in which useRs had the correct expectations which promptly were met by

> > R is a tool; a very powerful one and hence also very sharp.  It is
> > easy to cut yourself with it, but when one knows how to use it
> > gives the results that one expects.  I guess the problem in this
> > age of instant gratification is that people are not willing to put
> > in the time and effort to learn about the tools they are using.  
> but a good tool should be made with care for how users will use it.  

But the group of users change, and sometimes one cannot foresee all
possible ways in which future users may use the software.  As a
programming paradigm says, "you cannot make a piece of software
idiot-proof; nature will always come up with a better idiot".  

> r apparently fits the ideas of its developers, 

That's the prerogative of the developers, isn't it?  But if it would
only fit their ideas, then it would only be used by them.  The fact
that it is used by many others seem to indicate that it fits also the
ideas of many others.

> while confuses naive users.  

Well, many judiciaries have staged driver licenses for motorcycle;
initially allowing only low-powered machine for new users with
increasing powerful machines allowed for more experiences users.  Some
people in Australia would like to introduce a similar system for
car-drivers since, apparently, too many P-platers kill themselves with
high-powered V8 cars (though, I am not sure whether this is a problem
of looking at absolute numbers instead of the appropriate rates).

Perhaps something similar should be introduced for R.  Beginners (i.e.
naive users) are only used to use R via one of the GUI interfaces,
preferably one that shows the commands that are executed after some
point-and-click selection.  After one year, the user is allowed to type
commands on the command line; but only commands that he or she saw
during the previous year and after reading the help file of that
command.  After a further year, he or she is allowed to use R fully.

> i do not opt for redmond-like 'i know better what you want'
> intelligence, but i think some of the confusions should be predicted
> and the design tuned accordingly.

If you try to predict every possible confusion, and try to design it
away, you will end up with a software package that will probably be
completely useless because it does not allow the users to do anything.
Re-read the above comment about nature, evolution and idiots.....
> > How about spending some time learning about R instead of
> > continuously griping about it?  Just imagine how much you could
> > have learned in the time you spend writing all those e-mails. :)
> >   
> i learn a lot while writing these emails, 

Good, now after learning about how R works, you could start learning
how the R-community works, how to go about to get changes in R
implemented and, perhaps even more general, how open/free-source
communities work.

> but there would be little progress if we all were buying what we are
> given instead of critically examining it.  i can stop posting at any
> moment, but i don't think it would help the community ;)

And your postings do?

> [...] my purpose is not (or not just, if you prefer) to annoy the r
> team, but to point out and document issues that really need
> rethinking.  discouragingly, many of these issues appear to be known
> already, but simply ignored. 

Not ignored.  If you spent enough time on the mailing lists and/or
speak with R developers on conferences, you will realise that these
issues have been discussed, several options considered and the one
which is most in the "spirit of R" implemented.  

Best wishes,


=========================== Full address =============================
Berwin A Turlach                            Tel.: +65 6515 4416 (secr)
Dept of Statistics and Applied Probability        +65 6515 6650 (self)
Faculty of Science                          FAX : +65 6872 3919       
National University of Singapore
6 Science Drive 2, Blk S16, Level 7          e-mail: statba at nus.edu.sg
Singapore 117546                    http://www.stat.nus.edu.sg/~statba

More information about the R-help mailing list