Re: [R] Prevent Printing Function's Environment

2018-08-14 Thread Martin Maechler
> Abs Spurdle > on Tue, 14 Aug 2018 15:16:08 +1200 writes: > Hi All > When you print a function constructed within a function, R > prints it's environment. For example: > > myfunction = function () > + { f = function () NULL > + attributes (f) = lis

Re: [R] Prevent Printing Function's Environment

2018-08-14 Thread Rui Barradas
Hello, I am not sure I understand the question. You say that One way to prevent this [to print the attributes] is to set the function's environment to the global environment. But this is not true, just see the example below, where I set the function's environment to .GlobalEnv myfunction2

[R] Prevent Printing Function's Environment

2018-08-14 Thread Abs Spurdle
Hi All When you print a function constructed within a function, R prints it's environment. For example: > myfunction = function () + { f = function () NULL + attributes (f) = list (class="myfunction", myattribute=1) + f + } > myfunction.f = myfunction () > myfunction.f function () NUL