[R] R design (was "Variable passed to function not used in function in select)

Rolf Turner r.turner at auckland.ac.nz
Tue Nov 11 21:18:46 CET 2008


On 12/11/2008, at 4:28 AM, Terry Therneau wrote:

>  I've read the back and forth this morning, and I have to side with  
> Vince.

	Well, I've read back and forth this morning and I have to side
	with Berwin Turlach --- whose postings were, I thought, extremely
	well expressed.

	I'm getting heartily sick of Wacek Kusnierczyk's truculent whinging.
	(One might also add the adjectives pedantic, dogmatic, and arrogant.)
	His ranting, in another thread, about the distinction between `equal'
	and `identical' would have been risible were it not so boring.

	The whinging boils down to ``R is not perfect, so trash the whole thing
	and start again''.  This is rubbish.

	*Mostly* R is very easy to use and does exactly what the user would
	expect.  Sometimes it does not do what the user would (naively) expect;
	sometimes there are good reasons for this, sometimes not.  Sometimes,
	though very rarely, it might be possible to change the language so as
	to meet naive expectations.  Mostly it would be better for the user to
	become less naive.

	By and large the difficulties arise only in obscure contexts, when
	the user is trying to do something sophisticated.  If a naive user  
tries
	to do something sophisticated, then he or she should be on the  
lookout for
	problems and should check results carefully.  In elementary usage there
	are hardly ever any problems.

>  1. Functions that re-interpret their arguments are very  
> dangerous.  The
> original question involved a well formed call to a function, which  
> returned the
> wrong answer.

	Fair enough comment ....

> Bug, design flaw, whatever -- it's a mistake and the best choice
> would be to fix it.

	.... but it might not be fixable in practical terms, i.e. fixing it
	might have worse consequences than leaving it alone.

	<snip>

> 2. The documentation of subset is not in any way clear.  I would  
> never have
> been able to diagnose or work around this bug.  The issues are very  
> subtle.

	Well, that's true for some value of ``clear''.

> I quite often see "it's in the manual so we bear no blame" as an  
> argument on
> this list.  We all need to remember that our view of what we are  
> particularly
> close to is a distorted one -- I for instance think that everything  
> about the
> survival package is crystal clear --- and be particularly open to  
> concerns that
> something is opaque or subtle.

	I agree with this, for sure.

	But I think that the best approach would be to include a warning in
	the documentation of subset, to the effect:  ``There are subtle and
	difficult issues involved in the use of this function.  If you don't
	understand them, don't mess with it.''

	Others have pointed out in this thread that one does not *have* to use
	subset() --- anything it can do can be done in other ways.  Like those
	who pointed this out, I myself have never used subset(), never felt I
	had to, and never felt any the worse for not having done so.

	<snip>

> And let's not shoot the bearers of bad news.

	Bearing bad news is not the same thing as bad-tempered and just plain
	rude criticism.

		cheers,

			Rolf

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}



More information about the R-help mailing list