> 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
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
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
3 matches
Mail list logo