[R] Writing a workable function

Bill Venables William.Venables at cmis.CSIRO.AU
Wed Aug 16 01:58:55 CEST 2000

Ben Bolker writes:

>   Perhaps a short description of this issue [functions, return values,
> assignment, printing intermediate results] could go in the R FAQ?  If no
> one else will, I'd be willing to take a shot at writing it ...  I would
> personally be inclined to give the hint, in a suitably deprecated form,
> about global assignment, but also to try to clarify the reasons why it's a
> bad idea.

Unfortunately I don't think a short description is likely to be good
enough and a long description is unlikely to be very rivetting stuff.
The problem is that some people come to an S based system (like R)
often somewhat reluctantly from a macro based system and cannot seem
to get past the macro style of thinking.  These people often become
positively desperate to make R behave just like the old system but of
course in so doing they prevent themselves from ever learning how to
use the new system well.

If you try to build on what macro-based thinkers know to explain how
an S based system differs (and offers more) you can find that in just
explaining those differences you unwittingly supply the very
information they need to feed their desperation and you end up
creating that barrier for them that they are so anxious to erect!

I'd say go ahead and have a go by all means, but be careful in what
you write as it is a very tricky and sensitive area.

Bill Venables.
Bill Venables,      Statistician,     CMIS Environmetrics Project
CSIRO Marine Labs, PO Box 120, Cleveland, Qld,  AUSTRALIA.   4163
Tel: +61 7 3826 7251           Email: Bill.Venables at cmis.csiro.au    
Fax: +61 7 3826 7304      http://www.cmis.csiro.au/bill.venables/

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list