[Rd] Enlightenment sought and a possible buglet in vector.Rd

Berwin A Turlach berwin at maths.uwa.edu.au
Mon Dec 5 05:05:19 CET 2005


G'day Brian,

>>>>> "BDR" == Prof Brian Ripley <ripley at stats.ox.ac.uk> writes:

    BDR> On Fri, 2 Dec 2005, Berwin A Turlach wrote: [...]

    >> The second behaviour that I cannot explain was produced by code
    >> written by somebody else, namely:
    [...]
    >> The documentation of function() says that if "the end of a
    >> function is reached without calling 'return', the value of the
    >> last evaluated expression is returned."  And this seems to
    >> happen in this case:

    BDR> Yes, but that value can be returned with R_Visible set to 0,
    BDR> by calling invisible() _or otherwise_.
Thanks for the clarification.  I had the sneaking suspicion that
something like this was happening, but couldn't find anything in the
documentation.

I vaguely remember that S has a mechanism to switch auto-printing
on/off via a variable, whose name started with ".", but couldn't find
anything in the blue book (by now I found .Auto.print in Suesselbeck
and VR "S programming).  Since we don't have a license for S-plus
anymore, I couldn't check S-Plus and I didn't find anything similar in
R.  I take it that R handles all this via R_Visible at the C level?

    BDR> R does not print the value of a while() loop.  [...]  (Look
    BDR> up the code of do_while for why.)
I can see that in the code of do_while the variable R_Visible is set
to zero, but there is no explanation for why this is done.  But I
guess it is for compatibility reasons with S, since by now I found in
various books on the S language that the  while() loop returns its
value invisible.

Thanks for adding the value section to the help page to clarify this
issue in the R documentation.

Cheers,

        Berwin



More information about the R-devel mailing list