On 17/07/2014, 10:00 PM, Dario Strbenac wrote:
> The example in the question was not inside a user function.

The explanations you were given were slightly inaccurate.  The usual
rule is that results returned at the top level are printed unless they
are marked as invisible.  (There are a few cases where "top level" is
faked, e.g. in example code, and in Sweave.)

When you do something like

if(test) { a; b; c }

you have an expression that returns NULL invisibly if the test is FALSE,
and returns the value of the block (i.e. c) visibly if it is TRUE.  It
is the value of the if that is printed.

There is no difference in the handling of a, b and c:  each is an
expression that returns the value of the corresponding variable without
marking it as invisible.  But none of them are top-level expressions, so
none of them print.

Duncan Murdoch

______________________________________________
R-help@r-project.org mailing list
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.

Reply via email to